Skip to content

Instantly share code, notes, and snippets.

@benjamn
Last active March 15, 2018 18:09
Show Gist options
  • Save benjamn/de4b929ca88283925053a98d03f10ec5 to your computer and use it in GitHub Desktop.
Save benjamn/de4b929ca88283925053a98d03f10ec5 to your computer and use it in GitHub Desktop.
import { makeExecutableSchema } from "graphql-tools";
import { UniqueIdDirective } from "anyone-could-implement-this-package";
const typeDefs = `
type Query {
people: [Person]
}
# This hypothetical type uses both the "Person" type name and the value
# of the personID field to synthesize a globally unique ID field:
type Person @uid(from: "personID") {
personID: Int
name: String
}`;
const schema = makeExecutableSchema({
typeDefs,
schemaDirectives: {
uid: UniqueIdDirective
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment