Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
156 changes: 85 additions & 71 deletions src/execution/__tests__/abstract-promise-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,19 @@ describe('Execute: Handles execution of abstract types with promises', () => {
types: [CatType, DogType],
});

const query = `{
pets {
name
... on Dog {
woofs
}
... on Cat {
meows
const query = `
{
pets {
name
... on Dog {
woofs
}
... on Cat {
meows
}
}
}
}`;
`;

const result = await graphql(schema, query);

Expand Down Expand Up @@ -159,17 +161,19 @@ describe('Execute: Handles execution of abstract types with promises', () => {
types: [CatType, DogType],
});

const query = `{
pets {
name
... on Dog {
woofs
}
... on Cat {
meows
const query = `
{
pets {
name
... on Dog {
woofs
}
... on Cat {
meows
}
}
}
}`;
`;

const result = await graphql(schema, query);

Expand All @@ -180,12 +184,12 @@ describe('Execute: Handles execution of abstract types with promises', () => {
errors: [
{
message: 'We are testing this error',
locations: [{ line: 2, column: 7 }],
locations: [{ line: 3, column: 9 }],
path: ['pets', 0],
},
{
message: 'We are testing this error',
locations: [{ line: 2, column: 7 }],
locations: [{ line: 3, column: 9 }],
path: ['pets', 1],
},
],
Expand Down Expand Up @@ -230,18 +234,20 @@ describe('Execute: Handles execution of abstract types with promises', () => {
}),
});

const query = `{
pets {
... on Dog {
name
woofs
}
... on Cat {
name
meows
const query = `
{
pets {
... on Dog {
name
woofs
}
... on Cat {
name
meows
}
}
}
}`;
`;

const result = await graphql(schema, query);

Expand Down Expand Up @@ -324,17 +330,19 @@ describe('Execute: Handles execution of abstract types with promises', () => {
types: [CatType, DogType],
});

const query = `{
pets {
name
... on Dog {
woofs
}
... on Cat {
meows
const query = `
{
pets {
name
... on Dog {
woofs
}
... on Cat {
meows
}
}
}
}`;
`;

const result = await graphql(schema, query);

Expand All @@ -356,7 +364,7 @@ describe('Execute: Handles execution of abstract types with promises', () => {
{
message:
'Runtime Object type "Human" is not a possible type for "Pet".',
locations: [{ line: 2, column: 7 }],
locations: [{ line: 3, column: 9 }],
path: ['pets', 2],
},
],
Expand Down Expand Up @@ -421,18 +429,20 @@ describe('Execute: Handles execution of abstract types with promises', () => {
}),
});

const query = `{
pets {
... on Dog {
name
woofs
}
... on Cat {
name
meows
const query = `
{
pets {
... on Dog {
name
woofs
}
... on Cat {
name
meows
}
}
}
}`;
`;

const result = await graphql(schema, query);

Expand All @@ -454,7 +464,7 @@ describe('Execute: Handles execution of abstract types with promises', () => {
{
message:
'Runtime Object type "Human" is not a possible type for "Pet".',
locations: [{ line: 2, column: 7 }],
locations: [{ line: 3, column: 9 }],
path: ['pets', 2],
},
],
Expand Down Expand Up @@ -507,17 +517,19 @@ describe('Execute: Handles execution of abstract types with promises', () => {
types: [CatType, DogType],
});

const query = `{
pets {
name
... on Dog {
woofs
}
... on Cat {
meows
const query = `
{
pets {
name
... on Dog {
woofs
}
... on Cat {
meows
}
}
}
}`;
`;

const result = await graphql(schema, query);

Expand Down Expand Up @@ -579,17 +591,19 @@ describe('Execute: Handles execution of abstract types with promises', () => {
types: [CatType, DogType],
});

const query = `{
pets {
name
... on Dog {
woofs
}
... on Cat {
meows
const query = `
{
pets {
name
... on Dog {
woofs
}
... on Cat {
meows
}
}
}
}`;
`;

const result = await graphql(schema, query);

Expand All @@ -600,12 +614,12 @@ describe('Execute: Handles execution of abstract types with promises', () => {
errors: [
{
message: 'We are testing this error',
locations: [{ line: 2, column: 7 }],
locations: [{ line: 3, column: 9 }],
path: ['pets', 0],
},
{
message: 'We are testing this error',
locations: [{ line: 2, column: 7 }],
locations: [{ line: 3, column: 9 }],
path: ['pets', 1],
},
],
Expand Down
86 changes: 47 additions & 39 deletions src/execution/__tests__/abstract-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,19 @@ describe('Execute: Handles execution of abstract types', () => {
types: [CatType, DogType],
});

const query = `{
pets {
name
... on Dog {
woofs
}
... on Cat {
meows
const query = `
{
pets {
name
... on Dog {
woofs
}
... on Cat {
meows
}
}
}
}`;
`;

const result = graphqlSync(schema, query);

Expand Down Expand Up @@ -246,17 +248,19 @@ describe('Execute: Handles execution of abstract types', () => {
types: [CatType, DogType],
});

const query = `{
pets {
name
... on Dog {
woofs
}
... on Cat {
meows
const query = `
{
pets {
name
... on Dog {
woofs
}
... on Cat {
meows
}
}
}
}`;
`;

const result = graphqlSync(schema, query);

Expand All @@ -278,7 +282,7 @@ describe('Execute: Handles execution of abstract types', () => {
{
message:
'Runtime Object type "Human" is not a possible type for "Pet".',
locations: [{ line: 2, column: 7 }],
locations: [{ line: 3, column: 9 }],
path: ['pets', 2],
},
],
Expand Down Expand Up @@ -341,18 +345,20 @@ describe('Execute: Handles execution of abstract types', () => {
}),
});

const query = `{
pets {
... on Dog {
name
woofs
}
... on Cat {
name
meows
const query = `
{
pets {
... on Dog {
name
woofs
}
... on Cat {
name
meows
}
}
}
}`;
`;

const result = graphqlSync(schema, query);

Expand All @@ -374,7 +380,7 @@ describe('Execute: Handles execution of abstract types', () => {
{
message:
'Runtime Object type "Human" is not a possible type for "Pet".',
locations: [{ line: 2, column: 7 }],
locations: [{ line: 3, column: 9 }],
path: ['pets', 2],
},
],
Expand Down Expand Up @@ -469,17 +475,19 @@ describe('Execute: Handles execution of abstract types', () => {
types: [CatType, DogType],
});

const query = `{
pets {
name
... on Dog {
woofs
}
... on Cat {
meows
const query = `
{
pets {
name
... on Dog {
woofs
}
... on Cat {
meows
}
}
}
}`;
`;

const result = graphqlSync(schema, query);

Expand Down
Loading