Js-graphql-intellij-plugin: config.json is missing, how to bring it back?

Created on 8 Jan 2017  路  9Comments  路  Source: jimkyndemeyer/js-graphql-intellij-plugin

As the plugin asked me to configure graphql.config.json, I said no, now the json file is missing, how do I set it up again, i tried to reinstall the plugin and delete my .idea folder, the plugin still do not create a new config.json.

Thank you

question

All 9 comments

just created my own config.json and it worked. But as I see, this plugin is not compatible to apollo?

Hi.

Thanks for using the plugin.

It should be compatible with Apollo's gql tagged templates. Can you elaborate on the issue you're seeing?

/Jim.

well it is compatible with the gpl tag, but all the functions of the plugin are not?

Every query within the gpl tag in WebStorm are tagged as "cannot query field ..." though those queries are correct and working.

It sounds like the plugin has not been configured to use your specific schema yet.

Have you edited your graphql.config.json file to point it at your schema? See the readme fields in that file for the various options.

Let me know if you have any additional questions.

yes, probably, but I am using react-apollo with graphql and it looks like it has another format for the schema, as your plugin needs... i have a schema.js and it looks like this:
export default typeDefs = [

...
type Query{
...]

For that use case, the request field in the config can be used to send an introspection query which fetches the schema types. Make sure your graphql server is up and running, and you've configured the request url to be the same as your client uses, then fetch the schema types as follows:

How do I reload a GraphQL Schema that was loaded from a URL?

In the the GraphQL tool window, select the "Current Errors" tab and click the "Restart JS GraphQL Language Service" button.

Closing this issue and marked as question. Feel free to ask any additional questions.

/Jim

Thank you for the fast respond, sadly it tells me the following:

Unable to load schema from "...myProject/graphql.schema.json". Expected {data:{__schema:...}} or {__schema:...} from a schema introspection query. Got root keys:

My client is sending the requests to http://localhost:3000/graphql
I edited the config json to:
"request": { "url" : "http://localhost:3000/graphql", "method" : "POST",...

My schema.json is empty, since I do not use it. Am I doing something wrong?

had to remove "file": "graphql.schema.json", now it works, thx

Was this page helpful?
0 / 5 - 0 ratings

Related issues

idkjs picture idkjs  路  3Comments

advance512 picture advance512  路  5Comments

MichaelDeBoey picture MichaelDeBoey  路  4Comments

MaxmaxmaximusAWS picture MaxmaxmaximusAWS  路  4Comments

thomastvedt picture thomastvedt  路  5Comments