-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use codegen in front-end applications, code examples using preset: front-end
#8184
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
d04c5dc
to
ca19f8b
Compare
@charlypoly I think we need another example for Dart/Flutter using the I would be happy to provide that, just let me know how you expect it to be and I will get it done. |
@Parables, this PR is especially focused on front-end examples but yes, feel free to create a PR for a sample app in a new |
@charlypoly Coming right up |
preset: front-end
Erm, a little help here: @charlypoly Looking through the examples directory, Please correct me if I am wrong. Thank you |
yes, exactly! |
Okay, let me provide that right away @charlypoly |
@charlypoly, there seem to be some breaking changes with the freezed package. Working on a fix on the plugin as well as the docs with the examples |
@charlypoly, I have created a PR with the fix here: #8273 Please take a look at it and accept it for me. Also, I can't access the examples-front-end branch in my fork so once this PR is accepted, Thanks very much for your time and support. Sincerely grateful, |
@charlypoly ╰─λ yarn build
yarn run v1.22.18
$ rimraf dist/ .bob/ tsconfig.tsbuildinfo
$ bob build
Error: Command failed with exit code 2: npx tsc --module es2022 --sourceMap false --inlineSourceMap false --outDir /run/media/parables/ParaDisk/workspace/packages/my-packages/graphql-code-generator/.bob/esm
packages/graphql-codegen-cli/tests/codegen.spec.ts(20,24): error TS2345: Argument of type '{ legacyFakeTimers: boolean; }' is not assignable to parameter of type '"legacy" | "modern"'.
packages/presets/graphql-modules/tests/integration.spec.ts(28,24): error TS2345: Argument of type '{ legacyFakeTimers: boolean; }' is not assignable to parameter of type '"legacy" | "modern"'.
at makeError (/run/media/parables/ParaDisk/workspace/packages/my-packages/graphql-code-generator/node_modules/execa/lib/error.js:60:11)
at handlePromise (/run/media/parables/ParaDisk/workspace/packages/my-packages/graphql-code-generator/node_modules/execa/index.js:118:26)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async buildTypeScript (/run/media/parables/ParaDisk/workspace/packages/my-packages/graphql-code-generator/node_modules/bob-the-bundler/dist/commands/build.js:62:33)
at async Object.handler (/run/media/parables/ParaDisk/workspace/packages/my-packages/graphql-code-generator/node_modules/bob-the-bundler/dist/commands/build.js:116:13) {
shortMessage: 'Command failed with exit code 2: npx tsc --module es2022 --sourceMap false --inlineSourceMap false --outDir /run/media/parables/ParaDisk/workspace/packages/my-packages/graphql-code-generator/.bob/esm',
command: 'npx tsc --module es2022 --sourceMap false --inlineSourceMap false --outDir /run/media/parables/ParaDisk/workspace/packages/my-packages/graphql-code-generator/.bob/esm',
escapedCommand: 'npx tsc --module es2022 --sourceMap false --inlineSourceMap false --outDir "/run/media/parables/ParaDisk/workspace/packages/my-packages/graphql-code-generator/.bob/esm"',
exitCode: 2,
signal: undefined,
signalDescription: undefined,
stdout: `packages/graphql-codegen-cli/tests/codegen.spec.ts(20,24): error TS2345: Argument of type '{ legacyFakeTimers: boolean; }' is not assignable to parameter of type '"legacy" | "modern"'.\n` +
`packages/presets/graphql-modules/tests/integration.spec.ts(28,24): error TS2345: Argument of type '{ legacyFakeTimers: boolean; }' is not assignable to parameter of type '"legacy" | "modern"'.`,
stderr: '',
failed: true,
timedOut: false,
isCanceled: false,
killed: false
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
|
@Parables, make sure your branch is up-to-date with |
I always sync with upstream before I do anything else.
All the same, I will try again and get back to you
…On Tue, Aug 23, 2022, 8:35 AM Charly POLY ***@***.***> wrote:
@charlypoly <https://github.com/charlypoly> yarn build throws the
following error
╰─λ yarn build
yarn run v1.22.18
$ rimraf dist/ .bob/ tsconfig.tsbuildinfo
$ bob build
Error: Command failed with exit code 2: npx tsc --module es2022 --sourceMap false --inlineSourceMap false --outDir /run/media/parables/ParaDisk/workspace/packages/my-packages/graphql-code-generator/.bob/esm
packages/graphql-codegen-cli/tests/codegen.spec.ts(20,24): error TS2345: Argument of type '{ legacyFakeTimers: boolean; }' is not assignable to parameter of type '"legacy" | "modern"'.
packages/presets/graphql-modules/tests/integration.spec.ts(28,24): error TS2345: Argument of type '{ legacyFakeTimers: boolean; }' is not assignable to parameter of type '"legacy" | "modern"'.
at makeError (/run/media/parables/ParaDisk/workspace/packages/my-packages/graphql-code-generator/node_modules/execa/lib/error.js:60:11)
at handlePromise (/run/media/parables/ParaDisk/workspace/packages/my-packages/graphql-code-generator/node_modules/execa/index.js:118:26)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async buildTypeScript (/run/media/parables/ParaDisk/workspace/packages/my-packages/graphql-code-generator/node_modules/bob-the-bundler/dist/commands/build.js:62:33)
at async Object.handler (/run/media/parables/ParaDisk/workspace/packages/my-packages/graphql-code-generator/node_modules/bob-the-bundler/dist/commands/build.js:116:13) {
shortMessage: 'Command failed with exit code 2: npx tsc --module es2022 --sourceMap false --inlineSourceMap false --outDir /run/media/parables/ParaDisk/workspace/packages/my-packages/graphql-code-generator/.bob/esm',
command: 'npx tsc --module es2022 --sourceMap false --inlineSourceMap false --outDir /run/media/parables/ParaDisk/workspace/packages/my-packages/graphql-code-generator/.bob/esm',
escapedCommand: 'npx tsc --module es2022 --sourceMap false --inlineSourceMap false --outDir "/run/media/parables/ParaDisk/workspace/packages/my-packages/graphql-code-generator/.bob/esm"',
exitCode: 2,
signal: undefined,
signalDescription: undefined,
stdout: `packages/graphql-codegen-cli/tests/codegen.spec.ts(20,24): error TS2345: Argument of type '{ legacyFakeTimers: boolean; }' is not assignable to parameter of type '"legacy" | "modern"'.\n` +
`packages/presets/graphql-modules/tests/integration.spec.ts(28,24): error TS2345: Argument of type '{ legacyFakeTimers: boolean; }' is not assignable to parameter of type '"legacy" | "modern"'.`,
stderr: '',
@Parables <https://github.com/Parables>, make sure your branch is
up-to-date with master
—
Reply to this email directly, view it on GitHub
<#8184 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJDDF3V3GGCNY3RVTB2CTFTV2SEOVANCNFSM55S3LHLA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Okay, then, make sure to do |
Thanks it worked
yarn install got stuck, so I cleared the cache, switched to a different
network and tried again.
It is now working fine.
Thanks very much for your help
…On Wed, Aug 24, 2022, 7:38 AM Charly POLY ***@***.***> wrote:
I always sync with upstream before I do anything else. All the same, I
will try again and get back to you
… <#m_8971595448681425669_>
On Tue, Aug 23, 2022, 8:35 AM Charly POLY *@*.*> wrote: @charlypoly
<https://github.com/charlypoly> https://github.com/charlypoly
<https://github.com/charlypoly> yarn build throws the following error ╰─λ
yarn build yarn run v1.22.18 $ rimraf dist/ .bob/ tsconfig.tsbuildinfo $
bob build Error: Command failed with exit code 2: npx tsc --module es2022
--sourceMap false --inlineSourceMap false --outDir
/run/media/parables/ParaDisk/workspace/packages/my-packages/graphql-code-generator/.bob/esm
packages/graphql-codegen-cli/tests/codegen.spec.ts(20,24): error TS2345:
Argument of type '{ legacyFakeTimers: boolean; }' is not assignable to
parameter of type '"legacy" | "modern"'.
packages/presets/graphql-modules/tests/integration.spec.ts(28,24): error
TS2345: Argument of type '{ legacyFakeTimers: boolean; }' is not assignable
to parameter of type '"legacy" | "modern"'. at makeError
(/run/media/parables/ParaDisk/workspace/packages/my-packages/graphql-code-generator/node_modules/execa/lib/error.js:60:11)
at handlePromise
(/run/media/parables/ParaDisk/workspace/packages/my-packages/graphql-code-generator/node_modules/execa/index.js:118:26)
at processTicksAndRejections (node:internal/process/task_queues:96:5) at
async buildTypeScript
(/run/media/parables/ParaDisk/workspace/packages/my-packages/graphql-code-generator/node_modules/bob-the-bundler/dist/commands/build.js:62:33)
at async Object.handler
(/run/media/parables/ParaDisk/workspace/packages/my-packages/graphql-code-generator/node_modules/bob-the-bundler/dist/commands/build.js:116:13)
{ shortMessage: 'Command failed with exit code 2: npx tsc --module es2022
--sourceMap false --inlineSourceMap false --outDir
/run/media/parables/ParaDisk/workspace/packages/my-packages/graphql-code-generator/.bob/esm',
command: 'npx tsc --module es2022 --sourceMap false --inlineSourceMap false
--outDir
/run/media/parables/ParaDisk/workspace/packages/my-packages/graphql-code-generator/.bob/esm',
escapedCommand: 'npx tsc --module es2022 --sourceMap false
--inlineSourceMap false --outDir
"/run/media/parables/ParaDisk/workspace/packages/my-packages/graphql-code-generator/.bob/esm"',
exitCode: 2, signal: undefined, signalDescription: undefined, stdout:
packages/graphql-codegen-cli/tests/codegen.spec.ts(20,24): error TS2345:
Argument of type '{ legacyFakeTimers: boolean; }' is not assignable to
parameter of type '"legacy" | "modern"'.\n +
packages/presets/graphql-modules/tests/integration.spec.ts(28,24): error
TS2345: Argument of type '{ legacyFakeTimers: boolean; }' is not assignable
to parameter of type '"legacy" | "modern"'., stderr: '', @Parables
<https://github.com/Parables> https://github.com/Parables
<https://github.com/Parables>, make sure your branch is up-to-date with
master — Reply to this email directly, view it on GitHub <#8184 (comment)
<#8184 (comment)>>,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AJDDF3V3GGCNY3RVTB2CTFTV2SEOVANCNFSM55S3LHLA
<https://github.com/notifications/unsubscribe-auth/AJDDF3V3GGCNY3RVTB2CTFTV2SEOVANCNFSM55S3LHLA>
. You are receiving this because you were mentioned.Message ID: @.*>
Okay, then, make sure to do yarn install at the root of the project
The typing error you get is linked to a recent update on jest
—
Reply to this email directly, view it on GitHub
<#8184 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJDDF3QM7HOFKQLEH4BHZCTV2XGRDANCNFSM55S3LHLA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Merged with #8248 PR |
How to use codegen in front-end applications, code examples using
gql-tag-operations-preset
.React
graphql-request
(CRA app)Vue
@vue/apollo-composable
@urql/vue
villus
Angular (wip 🚧)
Advanced