Skip to content
This repository was archived by the owner on Sep 2, 2020. It is now read-only.
This repository was archived by the owner on Sep 2, 2020. It is now read-only.

Globs specified by .graphqlconfig includes are not honored as intended by spec #222

@mgadda

Description

@mgadda

According to the graphqlconfig spec, the string values contained within the includes value of .graphqlconfig (either top-level or project-level) are to be treated as file globs. However, graphql-language-service makes some incorrect assumptions about the structure of those globs (e.g. that they contain wildcards) and then replaces a portion of the glob with a hard-coded definition. Here's an example:

{
  "includes": [ "path/to/**/*.graphql" ]
}

"path/to/**/*.graphql" gets truncated at the first wildcard, then *.{js,graphql} is appended to produce:

"path/to/**/*.{js,graphql}"

While the set of .js and .graphql files isn't a bad set from which to extract queries and fragments, it's not actually what the user intended in this case (i.e. they intend to include JavaScript files).

I think the only reasonable expectation a user can have about how includes should behave is as defined by the spec.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions