You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As graphql-let is not actively maintains anymore, I think a disclaimer should be add at the start of the README file.
Two years ago I add the opportunity to use this tool and it has been the greatest dev experience I had with GraphQL & React. I really want to thanks @piglovesyou and others maintainers for producing this tool.
As today, I again have to use GraphQL with React (nextjs) in a monorepo, I am facing the same tooling hell where you don't know what to choose and how to configures it.
I have ended up using GraphqlCodegen and succeed to mimic the experience of graphql-let.
Here is how I did it:
For each .graphql files generate a .graphql.ts. codegen.ts:
constconfig: IGraphQLConfig={// using projects to support multiple GraphQL schemaprojects: {admin: {schema: 'http://localhost:8080/v1/graphql',extensions: {codegen: {generates: {'./src/admin.ts': {config: generateConfig,plugins: ['typescript'],},admin: {preset: 'near-operation-file',presetConfig: {extension: '.graphql.ts',baseTypesPath: '~@foo-bar/graphql-codegen/src/admin',},documents: ['../../apps/**/src/pages/api/**/*.graphql',],plugins: ['typescript-operations','typed-document-node'],config: generateConfig,},},}},},// ...}}
To be able to do import like import { MyDocument } from './foo.graphql' we have to resolves the alias in the webpack config. webpack.config.js:
Hello,
As
graphql-let
is not actively maintains anymore, I think a disclaimer should be add at the start of the README file.Two years ago I add the opportunity to use this tool and it has been the greatest dev experience I had with GraphQL & React. I really want to thanks @piglovesyou and others maintainers for producing this tool.
As today, I again have to use GraphQL with React (nextjs) in a monorepo, I am facing the same tooling hell where you don't know what to choose and how to configures it.
I have ended up using GraphqlCodegen and succeed to mimic the experience of
graphql-let
.Here is how I did it:
For each
.graphql
files generate a.graphql.ts
.codegen.ts
:To be able to do import like
import { MyDocument } from './foo.graphql'
we have to resolves the alias in the webpack config.webpack.config.js
:You can also hide the
.graphql.ts
files from your editor so you don't even thinks about the code generation.Best regards.
The text was updated successfully, but these errors were encountered: