Skip to content

Instantly share code, notes, and snippets.

View AdamZaczek's full-sized avatar

Adam Żaczek AdamZaczek

View GitHub Profile
@AdamZaczek
AdamZaczek / GraphQL3.js
Created April 25, 2017 23:13
GraphQL Getting Started Code Fragment 3
users: {
type: new GraphQLList(User),
description: 'Netguru members',
resolve: () => {
return USER.find({}, (err, res) => {
return res;
});
}
}
@AdamZaczek
AdamZaczek / GraphQL2.js
Created April 25, 2017 23:12
GraphQL Getting Started Code Fragment 2
import {
GraphQLList,
GraphQLObjectType,
GraphQLSchema,
GraphQLString,
} from 'graphql';
@AdamZaczek
AdamZaczek / GraphQL1.js
Last active April 25, 2017 23:12
GraphQL Getting Started Code Fragment 1
const User = new GraphQLObjectType({
name: 'User',
description: 'Represents user',
fields: () => ({
_id: { type: GraphQLString },
firstName: { type: GraphQLString },
lastName: { type: GraphQLString },
role: { type: GraphQLString }
})
});