Skip to content

Instantly share code, notes, and snippets.

@frikille
Last active August 29, 2015 14:25
Show Gist options
  • Save frikille/9f36b50f1baef017dc0d to your computer and use it in GitHub Desktop.
Save frikille/9f36b50f1baef017dc0d to your computer and use it in GitHub Desktop.
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