Created
April 20, 2019 12:04
-
-
Save shailen-naidoo/e2498ca0b181da577de4af2f8d6e58cd to your computer and use it in GitHub Desktop.
This file contains hidden or 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 { gql } from 'apollo-server-express'; | |
import { DocumentNode } from 'graphql' | |
import Types from './types'; | |
export enum Person { | |
Type: 'Person!' | |
} | |
interface TypePersonFields { | |
name: Types.StringNonNull; | |
surname: Types.StringNonNull; | |
} | |
interface TypeQueryPersonFields { | |
person: Person.Type | |
} | |
export const createTypePerson = ({ name, surname }: TypePersonFields): DocumentNode => gql` | |
type Person { | |
name: ${name} | |
surname: ${surname} | |
} | |
`; | |
export const createTypeQueryPerson = ({ person }: TypeQueryPersonFields): DocumentNode => gql` | |
extend type Query { | |
person: ${person} | |
} | |
`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment