Skip to content

Commit

Permalink
Use right type of nodes in @relay directive definition
Browse files Browse the repository at this point in the history
Summary:This was just working by accident, but using the wrong type of node.
Closes #991

Reviewed By: yungsters

Differential Revision: D3097243

Pulled By: kassens

fb-gh-sync-id: 4c43b6e2c3af2a4cb4189c59e60e70c3be84eb5a
fbshipit-source-id: 4c43b6e2c3af2a4cb4189c59e60e70c3be84eb5a
  • Loading branch information
kassens authored and Facebook Github Bot 2 committed Mar 25, 2016
1 parent 97c977a commit cc6a86c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
15 changes: 10 additions & 5 deletions scripts/babel-relay-plugin/lib/GraphQLRelayDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,35 @@

'use strict';

var types = require('./GraphQL').type;
var TypeKind = require('./GraphQL').type_introspection.TypeKind;

var BOOLEAN = {
kind: TypeKind.SCALAR,
name: 'Boolean'
};

module.exports = {
name: 'relay',
description: 'The @relay directive.',
args: [{
name: 'isConnectionWithoutNodeID',
description: 'Marks a connection field as containing nodes without `id` fields. ' + 'This is used to silence the warning when diffing connections.',
type: types.GraphQLBoolean,
type: BOOLEAN,
defaultValue: null
}, {
name: 'isStaticFragment',
description: 'Marks a fragment as static. A static fragment will share the same ' + 'identity regardless of how many times the expression is evaluated.',
type: types.GraphQLBoolean,
type: BOOLEAN,
defaultValue: null
}, {
name: 'pattern',
description: 'Marks a fragment as intended for pattern matching (as opposed to ' + 'fetching).',
type: types.GraphQLBoolean,
type: BOOLEAN,
defaultValue: null
}, {
name: 'plural',
description: 'Marks a fragment as being backed by a GraphQLList',
type: types.GraphQLBoolean,
type: BOOLEAN,
defaultValue: null
}],
onOperation: false,
Expand Down
2 changes: 1 addition & 1 deletion scripts/babel-relay-plugin/lib/HASH
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Zg3QrGbNgpdr/BI9SPAEdd7NRLA=
cRDRB56Au9mTP+fcN+3aKAhi/xE=
15 changes: 10 additions & 5 deletions scripts/babel-relay-plugin/src/GraphQLRelayDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@

'use strict';

const types = require('./GraphQL').type;
const TypeKind = require('./GraphQL').type_introspection.TypeKind;

const BOOLEAN = {
kind: TypeKind.SCALAR,
name: 'Boolean',
};

module.exports = {
name: 'relay',
Expand All @@ -23,29 +28,29 @@ module.exports = {
description:
'Marks a connection field as containing nodes without `id` fields. ' +
'This is used to silence the warning when diffing connections.',
type: types.GraphQLBoolean,
type: BOOLEAN,
defaultValue: (null: ?boolean),
},
{
name: 'isStaticFragment',
description:
'Marks a fragment as static. A static fragment will share the same ' +
'identity regardless of how many times the expression is evaluated.',
type: types.GraphQLBoolean,
type: BOOLEAN,
defaultValue: (null: ?boolean),
},
{
name: 'pattern',
description:
'Marks a fragment as intended for pattern matching (as opposed to ' +
'fetching).',
type: types.GraphQLBoolean,
type: BOOLEAN,
defaultValue: (null: ?boolean),
},
{
name: 'plural',
description: 'Marks a fragment as being backed by a GraphQLList',
type: types.GraphQLBoolean,
type: BOOLEAN,
defaultValue: (null: ?boolean),
},
],
Expand Down

0 comments on commit cc6a86c

Please sign in to comment.