Skip to content

Commit 4c3235d

Browse files
committed
fix(Dependencies): Fixes due deprecated methods in graphql-compose
1 parent f2b2397 commit 4c3235d

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"homepage": "https://github.com/nodkz/graphql-compose-relay",
2525
"peerDependencies": {
2626
"graphql": ">=0.7.1 || >=0.8.0",
27-
"graphql-compose": ">=1.0.0"
27+
"graphql-compose": ">=1.4.0"
2828
},
2929
"devDependencies": {
3030
"babel-cli": "6.14.0",

src/__tests__/composeWithRelay-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ describe('composeWithRelay', () => {
6161
});
6262

6363
it('should resolve globalId in `user.id` field', async () => {
64-
rootQueryTypeComposer.addField('user',
64+
rootQueryTypeComposer.setField('user',
6565
userTypeComposer.getResolver('findById').getFieldConfig()
6666
);
6767
const schema = new GraphQLSchema({
@@ -79,7 +79,7 @@ describe('composeWithRelay', () => {
7979
});
8080

8181
it('should resolve globalId in `node.id` field', async () => {
82-
rootQueryTypeComposer.addField('user',
82+
rootQueryTypeComposer.setField('user',
8383
userTypeComposer.getResolver('findById').getFieldConfig()
8484
);
8585
const schema = new GraphQLSchema({
@@ -100,7 +100,7 @@ describe('composeWithRelay', () => {
100100
});
101101

102102
it('should passthru clientMutationId in mutations', async () => {
103-
rootMutationComposer.addField('createUser',
103+
rootMutationComposer.setField('createUser',
104104
userTypeComposer.getResolver('createOne').getFieldConfig()
105105
);
106106
const schema = new GraphQLSchema({

src/composeWithRelay.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export function composeWithRelay(
2121
}
2222

2323
if (typeComposer.getTypeName() === 'Query' || typeComposer.getTypeName() === 'RootQuery') {
24-
typeComposer.addField('node', nodeFieldConfig);
24+
typeComposer.setField('node', nodeFieldConfig);
2525
return typeComposer;
2626
}
2727

src/wrapMutationResolver.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export default function wrapMutationResolver(
5555

5656
// add `clientMutationId` to args.input field
5757
if (ITC && !ITC.hasField('clientMutationId')) {
58-
ITC.addField('clientMutationId', {
58+
ITC.setField('clientMutationId', {
5959
type: 'String',
6060
description: 'The client mutation ID used by clients like Relay to track the mutation. '
6161
+ 'If given, returned in the response payload of the mutation.',
@@ -102,14 +102,14 @@ export default function wrapMutationResolver(
102102

103103
const outputTC = new TypeComposer(outputType);
104104
if (!outputTC.hasField('nodeId')) {
105-
outputTC.addField('nodeId', {
105+
outputTC.setField('nodeId', {
106106
type: 'ID',
107107
description: 'The globally unique ID among all types',
108108
});
109109
}
110110

111111
if (!outputTC.hasField('clientMutationId')) {
112-
outputTC.addField('clientMutationId', {
112+
outputTC.setField('clientMutationId', {
113113
type: 'String',
114114
description: 'The client mutation ID used by clients like Relay to track the mutation. '
115115
+ 'If given, returned in the response payload of the mutation.',

0 commit comments

Comments
 (0)