Last active
August 29, 2015 14:25
-
-
Save frikille/9f36b50f1baef017dc0d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import { graphql } from 'graphql'; | |
import schema from '../graphql/schema.js'; | |
export default { | |
query(body, request) { | |
let query = `query Query($loggedInUserId: Int) { | |
data(id: $loggedInUserId) { | |
${body} | |
} | |
}`; | |
let loggedInUserId = (request.session) ? request.session.passport.user : null; | |
return graphql(schema, query, 'Query', {loggedInUserId}); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment