Skip to content

Extensions config file search logic is not compatible with graphql-code-generator config search #21

Open
@Romanchuk

Description

@Romanchuk

I've struggled when trying to use single graphql config file for all vscode extensions (graphql releated):

  • graphql-codegen-vscode
  • graphql.vscode-graphql (Graphql language service)

graphql.vscode-graphql and @graphql-codegen/cli both searching configs by graphql-config rules

So for example if you have graphql.config.js file for config.

  • graphql.vscode-graphql (Graphql language service) will find it
  • @graphql-codegen/cli fill find it (run npm exec -- graphql-codegen)

but graphql-codegen-vscode won't, because it doesnt relay on @graphql-codegen/cli config search, it has it's own generateSearchPlaces.ts

So to setup "single" config i dive into graphql-codegen-vscode and found out that it has over config search logic. According to it i created codegen.js with content:

import conf from './graphql.config';

module.exports = {
	...conf
};

Not very clean...
Also until i created that file graphql-codegen-vscode didn't even alert that it can't find config. It just didn't run silently.

From my perspective as a creators of a 3rd party libraries/extensions based on a some original lib we should not override native/original logic. Because if we do - user of our lib must know docs of original lib and also our docs (if it exists). And our library inevitably will go out of date or you will need keep an eye on each release and sync your code with original.

So graphql-codegen-vscode should not override native behavior of @graphql-codegen/cli tooling. In that particular case - should not have alternative config search.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions