Skip to content
This repository has been archived by the owner on Jul 31, 2022. It is now read-only.

Obtuse error when starting #23

Closed
ThisIsMissEm opened this issue Jun 16, 2018 · 7 comments
Closed

Obtuse error when starting #23

ThisIsMissEm opened this issue Jun 16, 2018 · 7 comments
Labels
bug Something isn't working needs-reproduction
Milestone

Comments

@ThisIsMissEm
Copy link

ThisIsMissEm commented Jun 16, 2018

I just tried to set up the plugin for a project I'm working on where we have a monorepo — frontend & backend code in one repo. I've added a .graphqlconfig to the root of the project with:

{
  "schemaPath": "backend/src/sys/graphql/schema.graphql",
  "includes": ["*.graphql"],
  "extensions": {
    "endpoints": {
      "dev": {
        "url": "http://localhost:22015/graphql",
        "headers": {
          // secret-removed
        }
      }
    }
  }
}

The error I receive is:

Request initialize failed with message: Parsing <project path>/.graphqlconfig file has failed. Unexpected token } in JSON at position 277

@divyenduz
Copy link
Collaborator

@ThisIsMissEm : Thanks for raising the issue. Unable to replicate it so far but the issue comes from here. Maybe the config was still an invalid JSON when then extension loaded? It looks like the error is from JSON.parse.

Can you please confirm if it is still the case?

@marktani marktani added the bug Something isn't working label Jun 20, 2018
@Akryum
Copy link

Akryum commented Jul 22, 2018

I have found the extension to only work with .graphqlconfig.yml.

@jkelin
Copy link

jkelin commented Jul 11, 2019

The issue for me was that vscode autoformat has inserted a , after last }, which is valid with JSON5 but invalid in old JSON.

@divyenduz
Copy link
Collaborator

This is related kamilkisiela/graphql-config#119

@acao
Copy link
Member

acao commented Jul 14, 2020

i believe the new [email protected] also supports json5 config, if folks want comments in json :D

@acao acao added this to the 3.0.0 milestone Jul 14, 2020
@acao
Copy link
Member

acao commented Jul 15, 2020

because graphql-config@>3 uses cosmicconfig, you'll be able to use:

graphql.config.json5
.graphqlrc.json5

to use comments in JSON

@acao
Copy link
Member

acao commented Aug 26, 2020

0.3.1 released! please open new tickets if you have any issues

@acao acao closed this as completed Aug 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working needs-reproduction
Projects
None yet
Development

No branches or pull requests

6 participants