This repository has been archived by the owner on Dec 17, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(graphql): Remove HealthGraph root node
Removed the root healthgraph node in the graphQL schema, instead giving direct access from root to all keys from the /user call BREAKING CHANGE: Schema is no longer wrapped in root healthgraph key
- Loading branch information
Simon Wears
committed
Mar 19, 2017
1 parent
807f185
commit 08defbe
Showing
2 changed files
with
11 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,16 @@ | ||
const graphqlHTTP = require('express-graphql'); | ||
const graphql = require('graphql'); | ||
const GraphQLSchema = graphql.GraphQLSchema; | ||
const GraphQLObjectType = graphql.GraphQLObjectType; | ||
const fetch = require('../helpers/fetch'); | ||
|
||
const HealthGraphType = require('../data-types/user'); | ||
const UserType = require('../data-types/user'); | ||
|
||
module.exports = function (app) { | ||
|
||
app.use('/graphql', graphqlHTTP({ | ||
graphiql: true, | ||
schema: new GraphQLSchema({ | ||
query: new GraphQLObjectType({ | ||
name: 'HealthGraph', | ||
fields: { | ||
healthgraph: { | ||
type: HealthGraphType, | ||
resolve (parent, args, req) { | ||
return fetch('/user', req); | ||
} | ||
} | ||
} | ||
}) | ||
query: UserType | ||
}) | ||
|
||
})); | ||
|
||
}; |