Last active
March 15, 2018 18:09
-
-
Save benjamn/de4b929ca88283925053a98d03f10ec5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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