-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Schema Loading error on Generate SDL or Scaffold with Relation with Type Generation #4762
Comments
I've done some digging, and because type gen is using the cli version of the codgen, we cannot catch the error and see the type -- the cli outs the error message details. The option would be to suppress and do some string parsing but that seems impractical. Eventually, we could use the I still want to see if we can have some link to an explanation. So, I think I will start with a document describing the issue and how you can get out of it (though it is tricky as we know). |
I'm going to have a go at that over here: #4728 I plan to start working on that tomorrow |
I was mistaken. I switched to using graphql-codegen/core for gql documents. This PR needs it for the schema, which is another function. |
Thanks for working on this. One of the core selling points of Redwood is that code gen is easier than DIY. Ideally you don't have to add things one by one carefully checkpointing with git to avoid the scenario where the black box stops working and customers expect the software to work, etc. Would be nice to have a command that completely wipes out any generated stuff and rebuilds a valid schema and types. Even if that means automating removal of relations, one by one adding of relations, etc. in a command that is prominently documented as part of the CLI such as "If you have an intractable type error in GraphQL that makes no sense please try running yarn rw prisma migrate rebuild" |
Here is a Book that is on a Shelf. And a Shelf has many Books.
yarn rw prisma migrate dev
Now, I want sdls and services.
yarn rw g sdl Book --crud
Note: Ignore BigInt warning as that is a separate issue.
You can get out of this by
yarn rw g sdl Shelf --crud
yarn rw g types
This also impact scaffolding.
See also: #4394
The text was updated successfully, but these errors were encountered: