Have ideas to improve npm?Join in the discussion! »

@adeira/graphql-relay-fauna

0.2.0 • Public • Published

Helpers for Relay compliant GraphQL server with FaunaDB backend

Install

yarn add @adeira/graphql-relay-fauna

Basic usage

If your GraphQL type resolves from Fauna document, use GlobalFaunaID to automatically create id field with globally unique value. This is required for Global Object Identification and Node interface.

import GlobalFaunaID from '@adeira/graphql-relay-fauna';
 
export default new GraphQLObjectType({
  name: 'TypeName',
  fields: {
    id: GlobalFaunaID(),
  },
  interfaces: [GraphQLNodeInterface],
  isTypeOf: ({ ref }): boolean => ref.collection.id === 'TypeName',
});

Keywords

none

Install

npm i @adeira/[email protected]

Version

0.2.0

License

MIT

Unpacked Size

10.8 kB

Total Files

11

Last publish

Collaborators

  • avatar
  • avatar
  • avatar
  • avatar