houdini icon indicating copy to clipboard operation
houdini copied to clipboard

[Feature] support graphql-config

Open benbender opened this issue 4 years ago • 4 comments

Hey,

just thought it would be nice if houdini would support Graphql-config to get the endpoint and, possibly, to configure the path where the schema is pulled to. What do you think?

benbender avatar Aug 19 '21 05:08 benbender

I think its an interesting idea but I'm a bit wary to introduce/encourage yet another config file, especially one that seems to only work with CommonJS. Is there a specific tool you would like to integrate with?

AlecAivazis avatar Aug 20 '21 00:08 AlecAivazis

For me it's the single-source of truth for my graphql-config. Mainly because its natively supported in vscode-graphql.

In which way is it bound to CommonJS? Afaik they are using esbuild and the config itself can be in a variety of formats.

benbender avatar Aug 20 '21 06:08 benbender

re CommonJS, i just didn't see an esm file in their example but I might have missed it. I'm definitely in favor of adding support as long as we can easily embed the necessary scalar config and the rest of the houdini specifics

AlecAivazis avatar Aug 21 '21 16:08 AlecAivazis

Graphql-config file plays well with Houdini. You can configure a .graphqlrc.yaml with something like:

projects:
  default:
    schema:
      - ./schema.graphql
      - ./$houdini/graphql/schema.graphql
    documents:
      - **/*.gql
      - ./$houdini/graphql/documents.gql

And vscode plugin will take is as usual.


@benbender, you would like houdini.config.js to be inside .graphqlrc.yaml with the extension mechanism? I'm not sure any "main" config could be taken from Graphql-config, so everything would be in the extension. I understand the wish to have everything graphql in one place. I just would like a confirmation that this is still a need?

jycouet avatar Jul 17 '22 22:07 jycouet

I'm going to close this since its gone very stale. If this is still important to someone, please let me know and I'll gladly reopen the ticket

AlecAivazis avatar Sep 19 '22 19:09 AlecAivazis