Turn IDs into opaque identifiers for GraphQL.
Encode and decode IDs in Base64. Partial fork of graphql-relay-js
with slight changes. It does not rely node's internal Buffer
when encoding/decoding in Base64.
$ yarn add graphql-base64
Example:
import { globalIdField } from 'graphql-base64';
export const userType = new GraphQLObjectType({
name: 'User',
fields: () => ({
id: globalIdField(),
}),
});
Returns configuration for the id field of an object.
Encode a type name and ID in Base64.
Decode a global ID from Base64 and return it's type name and ID.