UNPKG

relay-runtime

Version:

A core runtime for building GraphQL-driven applications.

33 lines (32 loc) 684 B
'use strict'; var CONNECTION_CALLS = { after: true, before: true, find: true, first: true, last: true, surrounds: true }; var config = { CURSOR: 'cursor', EDGES: 'edges', END_CURSOR: 'endCursor', HAS_NEXT_PAGE: 'hasNextPage', HAS_PREV_PAGE: 'hasPreviousPage', NODE: 'node', PAGE_INFO_TYPE: 'PageInfo', PAGE_INFO: 'pageInfo', START_CURSOR: 'startCursor' }; var ConnectionInterface = { inject: function inject(newConfig) { config = newConfig; }, get: function get() { return config; }, isConnectionCall: function isConnectionCall(call) { return CONNECTION_CALLS.hasOwnProperty(call.name); } }; module.exports = ConnectionInterface;