Skip to content

Commit

Permalink
Merge pull request #150 from rexraphael/master
Browse files Browse the repository at this point in the history
Post returning non-null issue
  • Loading branch information
juicycleff committed Feb 26, 2018
2 parents 7e6fcdf + f6b1362 commit 0431cb5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion advanced/server/src/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
type Query {
feed: [Post!]!
drafts: [Post!]!
post(id: ID!): Post!
post(id: ID!): Post
me: User
}

Expand Down
4 changes: 2 additions & 2 deletions minimal/server/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ const opts = {

const resolvers = {
Query: {
hello: (_, { name }) => {
hello: (_, { name }) => {
const returnValue = !name ? `Hello ${name || 'World!'}` : null
return returnValue
},
},
}

const server = new GraphQLServer({ typeDefs, resolvers, opts })
server.start(() => console.log(`Server is running at http://localhost:${opts.port}`))
server.start(() => console.log(`Server is running at http://localhost:${opts.port}`))

0 comments on commit 0431cb5

Please sign in to comment.