Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use right type of nodes in @relay directive definition #991

Closed
wants to merge 1 commit into from
Closed
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
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