Skip to content

Instantly share code, notes, and snippets.

@brunocroh
Created September 7, 2019 01:47
Show Gist options
  • Save brunocroh/04005bb19d462b1ad30a5febdc942b6e to your computer and use it in GitHub Desktop.
Save brunocroh/04005bb19d462b1ad30a5febdc942b6e to your computer and use it in GitHub Desktop.
type Usuario {
16 ¦ id: ID
15 ¦ name: String
14 ¦ photos: [ Photo ]
13 }
12
11 type Photo {
10 ¦ id: ID
9 ¦ likes: Int
8 }
7 `
6
5 const resolvers = {
4 Query: {
3 ¦ hello: (_, { name }) => `Hello ${name || 'World'}`,
2 ¦ getUser: (_, { name }) => [{ name }]
1 },
27 Usuario: () => {
1
2 }
3
4 }
5
6 const server = new GraphQLServer({ typeDefs, resolvers })
7 server.start(() => console.log('Server is running on localhost:4000'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment