Skip to content

Instantly share code, notes, and snippets.

@gtkatakura-bysoft
Last active December 6, 2018 18:05
Show Gist options
  • Select an option

  • Save gtkatakura-bysoft/fa4cdffa9c8b7e2e275dc58b5d705c5b to your computer and use it in GitHub Desktop.

Select an option

Save gtkatakura-bysoft/fa4cdffa9c8b7e2e275dc58b5d705c5b to your computer and use it in GitHub Desktop.
const { introspectionQuery, buildClientSchema } = require('graphql')
const { validate } = require('graphql/validation')
const fetch = require('graphql-fetch')
const { gql } = require('apollo-boost')
const GET_HELLO = gql`
query HelloWorldQuery {
hell
}
`
fetch('http://localhost:4000')(introspectionQuery).then(function (results) {
const schema = buildClientSchema(results.data)
console.log(validate(schema, GET_HELLO))
})
@gtkatakura-bysoft

gtkatakura-bysoft commented Nov 19, 2018

Copy link
Copy Markdown
Author

@gtkatakura-bysoft

gtkatakura-bysoft commented Nov 20, 2018

Copy link
Copy Markdown
Author

@gtkatakura-bysoft

Copy link
Copy Markdown
Author

@gtkatakura-bysoft

Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment