Created
April 25, 2017 23:16
-
-
Save AdamZaczek/1c915c918617885caec4bda86a546a6d to your computer and use it in GitHub Desktop.
GraphQL Getting Started Code Fragment 6
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
const Skill = new GraphQLObjectType({ | |
name: 'Skill', | |
description: 'Represents skill', | |
fields: () => ({ | |
_id: { type: GraphQLString }, | |
name: { type: GraphQLString } | |
}) | |
}); | |
const SkillLevel = new GraphQLObjectType({ | |
name: 'SkillLevel', | |
description: 'Describes how well user knows certain skill.', | |
fields: () => ({ | |
_id: { type: GraphQLString }, | |
level: { | |
type: GraphQLInt, | |
description: 'Actual skill level, ranked from 1 to 3' | |
}, | |
favorite: { type: GraphQLBoolean } | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, thanks for your article about GraphQL, I am following it :)
question about this script, in your article you mentioned with above code we will be able to query skill and skillLevel in GraphiQL.
I think we need to add something in Query? just like helloQuery and Users. Please advise, thank you again