Skip to content

Instantly share code, notes, and snippets.

@rauljordan
Created September 27, 2017 02:45
Show Gist options
  • Save rauljordan/12bc02e7000a4f148870ed580f7b7ec9 to your computer and use it in GitHub Desktop.
Save rauljordan/12bc02e7000a4f148870ed580f7b7ec9 to your computer and use it in GitHub Desktop.
import {
graphql,
GraphQLSchema,
GraphQLObjectType,
GraphQLString
} from 'graphql';
import { HtmlPage } from './resolvers';
var schema = new GraphQLSchema({
query: new GraphQLObjectType({
name: 'Query',
fields: {
scrape: {
type: HtmlPage,
// `args` describes the arguments that the `scrape` query accepts
args: {
url: { type: GraphQLString }
},
resolve: function (_, { url }) {
return {
url
};
}
}
}
}),
});
export default schema;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment