Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

Commit

Permalink
Add company to rootquery
Browse files Browse the repository at this point in the history
  • Loading branch information
sicktastic committed Nov 3, 2017
1 parent ae651e0 commit 0158188
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions graphql/schema/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ const RootQuery = new GraphQLObjectType({
return axios.get(`http://localhost:3000/users/${args.id}`)
.then(resp => resp.data);
}
},
company: {
type: CompanyType,
args: { id: { type: GraphQLString } },
resolve(parentValue, args) {
return axios.get(`http://localhost:3000/companies/${args.id}`)
.then(resp => resp.data);
}
}
}
});
Expand Down

0 comments on commit 0158188

Please sign in to comment.