create valid relay schema.json
This commit is contained in:
20
config/graphql/node.js
Normal file
20
config/graphql/node.js
Normal file
@@ -0,0 +1,20 @@
|
||||
import {
|
||||
fromGlobalId,
|
||||
nodeDefinitions,
|
||||
} from 'graphql-relay';
|
||||
|
||||
var {nodeInterface, nodeField} = nodeDefinitions(
|
||||
(globalId) => {
|
||||
var {type, id} = fromGlobalId(globalId);
|
||||
return null;
|
||||
},
|
||||
(obj) => {
|
||||
if (obj instanceof Array) {
|
||||
return Array;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
export {nodeInterface, nodeField};
|
||||
Reference in New Issue
Block a user