Skip to content

Instantly share code, notes, and snippets.

@AdamZaczek
Created April 25, 2017 23:16
Show Gist options
  • Save AdamZaczek/1c915c918617885caec4bda86a546a6d to your computer and use it in GitHub Desktop.
Save AdamZaczek/1c915c918617885caec4bda86a546a6d to your computer and use it in GitHub Desktop.
GraphQL Getting Started Code Fragment 6
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 }
})
});
@dapeng09
Copy link

dapeng09 commented Aug 9, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment