Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

Endless definition updates even when nothing goes on #85

Open
kirill-konshin opened this issue Apr 13, 2020 · 6 comments
Open

Endless definition updates even when nothing goes on #85

kirill-konshin opened this issue Apr 13, 2020 · 6 comments

Comments

@kirill-konshin
Copy link

info [gatsby-plugin-graphql-codegen] definition for queries of schema default-gatsby-schema has been updated at ./src/lib/gatsby-graphql.ts
success extract queries from components - 0.059s
info [gatsby-plugin-graphql-codegen] definition for queries of schema default-gatsby-schema has been updated at ./src/lib/gatsby-graphql.ts
success extract queries from components - 0.055s
info [gatsby-plugin-graphql-codegen] definition for queries of schema default-gatsby-schema has been updated at ./src/lib/gatsby-graphql.ts
success extract queries from components - 0.092s
info [gatsby-plugin-graphql-codegen] definition for queries of schema default-gatsby-schema has been updated at ./src/lib/gatsby-graphql.ts
success extract queries from components - 0.076s
info [gatsby-plugin-graphql-codegen] definition for queries of schema default-gatsby-schema has been updated at ./src/lib/gatsby-graphql.ts
success extract queries from components - 0.110s

Setup is 100% per readme, nothing special. Editor is WebStorm, just in case.

@kirill-konshin
Copy link
Author

Also I notice that progressbar never settles, it always shows XX pages In Progress.

@kirill-konshin
Copy link
Author

Also I noticed that with the codegen running everything becomes extremely slow, dev pages open for seconds (instead of almost instantly).

I disabled the codegen option and the performance went back to normal, as well as the endless progress were no longer an issue.

@d4rekanguok
Copy link
Owner

Hi @kirill-konshin, thank you for opening an issue!

It looks like you're building typings into the src directory, which gatsby watches with no exception. For this reason a single edit triggers a loop, and likely contribute to the slowness you experience.

We mentioned this in the readme, but I think after many editing & moving things around it's no longer clear.

We'll detect src in user's custom filename and display a warning/error.

@kirill-konshin
Copy link
Author

Makes sense. Thank you for prompt response. Placing the file into /types dir worked. And yes, documentation does not mention it...

@d4rekanguok
Copy link
Owner

Yeah I realized we only mentioned this in the plugin readme, in a fairly hidden table 😅 Thank you for bringing this issue to light!

I'm thinking we can also build this file to node_modules so you can import it as if it's a library i.e

- import { IndexQuery } from '../../graphql-types'
+ import { IndexQuery } from 'gatsby-types`

@kirill-konshin
Copy link
Author

To me this looks like magic :) by default — maybe, but the check to not place it in src is a must.

nasustim added a commit to nasustim/nasustim.com that referenced this issue Nov 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants