Skip to content
This repository has been archived by the owner on Jun 17, 2022. It is now read-only.

adeira/graphql-relay-fauna

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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',
});

About

This repository is automatically exported from https://github.com/adeira/universe via Shipit

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published