-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
08a4a87
commit d4c533f
Showing
11 changed files
with
46 additions
and
71 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,7 +55,6 @@ const userType = new GraphQLObjectType({ | |
|
||
const { connectionType: friendConnection } = connectionDefinitions({ | ||
name: 'Friend', | ||
// @ts-expect-error | ||
nodeType: new GraphQLNonNull(userType), | ||
resolveNode: (edge) => allUsers[edge.node], | ||
edgeFields: () => ({ | ||
|
@@ -73,7 +72,6 @@ const { connectionType: friendConnection } = connectionDefinitions({ | |
}); | ||
|
||
const { connectionType: userConnection } = connectionDefinitions({ | ||
// @ts-expect-error | ||
nodeType: new GraphQLNonNull(userType), | ||
resolveNode: (edge) => allUsers[edge.node], | ||
}); | ||
|
@@ -184,8 +182,7 @@ describe('connectionDefinition()', () => { | |
}); | ||
|
||
it('generates correct types', () => { | ||
// FIXME remove trimEnd after we update to `[email protected]` | ||
expect(printSchema(schema).trimEnd()).to.deep.equal(dedent` | ||
expect(printSchema(schema)).to.deep.equal(dedent` | ||
type Query { | ||
user: User | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ import { | |
GraphQLSchema, | ||
graphql, | ||
graphqlSync, | ||
printType, | ||
printSchema, | ||
} from 'graphql'; | ||
|
||
|
@@ -48,24 +49,17 @@ describe('mutationWithClientMutationId()', () => { | |
}, | ||
mutateAndGetPayload: dummyResolve, | ||
}); | ||
const schema = wrapInSchema({ someMutation }); | ||
const source = ` | ||
mutation { | ||
someMutation { | ||
result | ||
} | ||
} | ||
`; | ||
|
||
expect(graphqlSync({ schema, source })).to.deep.equal({ | ||
errors: [ | ||
{ | ||
message: | ||
'Field "someMutation" argument "input" of type "SomeMutationInput!" is required, but it was not provided.', | ||
locations: [{ line: 3, column: 9 }], | ||
}, | ||
], | ||
const wrapperType = new GraphQLObjectType({ | ||
name: 'WrapperType', | ||
fields: { someMutation }, | ||
}); | ||
|
||
expect(printType(wrapperType)).to.deep.equal(dedent` | ||
type WrapperType { | ||
someMutation(input: SomeMutationInput!): SomeMutationPayload | ||
} | ||
`); | ||
}); | ||
|
||
it('returns the same client mutation ID', () => { | ||
|
@@ -317,8 +311,7 @@ describe('mutationWithClientMutationId()', () => { | |
|
||
const schema = wrapInSchema({ someMutation }); | ||
|
||
// FIXME remove trimEnd after we update to `[email protected]` | ||
expect(printSchema(schema).trimEnd()).to.deep.equal(dedent` | ||
expect(printSchema(schema)).to.deep.equal(dedent` | ||
type Query { | ||
dummy: Int | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,11 +48,11 @@ const { nodeField, nodesField, nodeInterface } = nodeDefinitions( | |
}, | ||
(obj) => { | ||
if (userData.includes(obj)) { | ||
return userType; | ||
return userType.name; | ||
} | ||
// istanbul ignore else (Can't be reached) | ||
if (photoData.includes(obj)) { | ||
return photoType; | ||
return photoType.name; | ||
} | ||
}, | ||
); | ||
|
@@ -315,8 +315,7 @@ describe('Node interface and fields', () => { | |
}); | ||
|
||
it('generates correct types', () => { | ||
// FIXME remove trimEnd after we update to `[email protected]` | ||
expect(printSchema(schema).trimEnd()).to.deep.equal(dedent` | ||
expect(printSchema(schema)).to.deep.equal(dedent` | ||
"""An object with an ID""" | ||
interface Node { | ||
"""The id of the object.""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,8 +78,7 @@ describe('pluralIdentifyingRootField()', () => { | |
}); | ||
|
||
it('generates correct types', () => { | ||
// FIXME remove trimEnd after we update to `[email protected]` | ||
expect(printSchema(schema).trimEnd()).to.deep.equal(dedent` | ||
expect(printSchema(schema)).to.deep.equal(dedent` | ||
type Query { | ||
"""Map from a username to the user""" | ||
usernames(usernames: [String!]!): [User] | ||
|