Created
November 30, 2016 22:01
-
-
Save holmesal/eb9de55c8966fca56e6f7fe5d9b5ba7a 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
var QueryType = new GraphQLObjectType({ | |
name: 'Query', | |
description: 'A type used to make queries', | |
fields: () => ({ | |
node: nodeDefinitions.nodeField, | |
viewer: { | |
type: types.UserType, | |
description: 'The currently authenticated user', | |
resolve: (parent, _, {user}) => user | |
}, | |
search: { | |
type: SearchResultConnection, | |
description: 'Search for things', | |
args: { | |
text: { | |
type: GraphQLString, | |
description: 'The text string to match', | |
required: true | |
}, | |
...connectionArgs | |
}, | |
resolve: (parent, {text}, context) => doSearch(text) | |
} | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment