Skip to content

Commit 61e1033

Browse files
authored
Merge pull request #112 from vantreeseba/fix_remove_return_type
Fix remove return type
2 parents 6d48a43 + 1db115e commit 61e1033

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ type Query {
109109
type Mutation {
110110
createPost(data: String): Post
111111
updatePost(data: String): Post
112-
removePost(id: ID!): Boolean
112+
removePost(id: ID!): Post
113113
}
114114
type Post {
115115
id: ID!

src/introspection/getSchemaFromData.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {
2-
GraphQLBoolean,
32
GraphQLID,
43
GraphQLInt,
54
GraphQLList,
@@ -149,7 +148,7 @@ export default (data) => {
149148
args: nullableTypeFields,
150149
};
151150
fields[`remove${type.name}`] = {
152-
type: GraphQLBoolean,
151+
type: typesByName[type.name],
153152
args: {
154153
id: { type: new GraphQLNonNull(GraphQLID) },
155154
},

src/introspection/getSchemaFromData.spec.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {
2-
GraphQLBoolean,
32
GraphQLID,
43
GraphQLInt,
54
GraphQLList,
@@ -228,7 +227,7 @@ test('creates three mutation fields per data type', () => {
228227
description: null,
229228
},
230229
]);
231-
expect(mutations['removePost'].type.name).toEqual(GraphQLBoolean.name);
230+
expect(mutations['removePost'].type.name).toEqual(PostType.name);
232231
expect(mutations['removePost'].args).toEqual([
233232
{
234233
name: 'id',
@@ -267,7 +266,7 @@ test('creates three mutation fields per data type', () => {
267266
description: null,
268267
},
269268
]);
270-
expect(mutations['removeUser'].type.name).toEqual(GraphQLBoolean.name);
269+
expect(mutations['removeUser'].type.name).toEqual(UserType.name);
271270
expect(mutations['removeUser'].args).toEqual([
272271
{
273272
defaultValue: undefined,

0 commit comments

Comments
 (0)