Current behavior
Here are some errors I got after introspecting my schema.
The field `id` is reserved and has to have the format: id: ID! @unique or id: Int! @unique.The relation field `receiver` must specify a `@relation` directive: `@relation(name: "MyRelation")`@pgRelation(column: "receiver_id") instead of @relationThe type `Users` has a duplicate fieldName.Those are the errors that occurred when trying to deploy. I fixed most of the errors manually, and then removed the problematic fields. This let me deploy, but when I opened up graphql playground I got the following error from the server: sangria.schema.NonUniqueFieldsError: All fields within 'Query' type should have unique names! Non-unique fields: 'members'.
Reproduction
I can give you guys the database schema if that would be helpful.
Expected behavior?
Everything should just work after introspecting.
Thanks a lot for opening this issue! It would be super helpful if you can additionally your database schema (or a minimal version that exhibits the same bugs).
Here are a few more prisma introspect errors with information about them! Any help in resolution/time frame for fix is appreciated :)
Error seen after prisma deploy
1)
Pg_stat_statements
✖ The field `dbid` has the type `null` but there's no type or enum declaration with that name.
✖ The field `userid` has the type `null` but there's no type or enum declaration with that name.
✖ The relation field `dbid` must specify a `@relation` directive: `@relation(name: "MyRelation")`
✖ The relation field `userid` must specify a `@relation` directive: `@relation(name: "MyRelation")`
Line in schema causing the above errors
enable_extension "pg_stat_statements"
2)
✖ The field `xxxxxxxxx` has the type `null` but there's no type or enum declaration with that name.
✖ The field `yyyyyyyy` has the type `null` but there's no type or enum declaration with that name.
is being seen for all fields of type:
t.inet "xxxxxxxxx"
t.date "yyyyyyyy"
so probably t.inet and t.date needs inclusion/fixing in prisma introspect
3)
The id error as reported previously is all over the place!
✖ The field `id` is reserved and has to have the format: id: ID! @unique.
4)
Finally, I am not sure why some fields give the below error about @relation
✖ The relation field `xxxxxxxxx` must specify a `@relation` directive: `@relation(name: "MyRelation")`
I am not sure if I can share the schema at this point, would need to get permission from my client.
I deleted the fields with the type null from the SDL and tried a prisma deploy. Prisma successfully detects the delta in the SDL (the changes between the original SDL and the SDL generated through introspect).
It then gets stuck at Applying changes (5/261) ⣯
@Jaikant : Thanks for sharing the details. Can you please also share your schema that exhibits these issues? That would expedite the fixes 🙂
@divyenduz thanks for your reply. I had moved on from here and currently working on something different. When I get back to it, I will create some sample schema to reproduce this issue.
Thanks everyone for your great feedback - we merged a lot of fixes to the introspection feature in 1.14 that should fix the issues you reported here.
I have version 1.23.1 and it still happens
@redbluenat : Thanks, there are a lot of issues mentioned in this thread, can you please create a new issue for which one(s) of them have regressed here: https://github.com/prisma/prisma/issues/new?template=bug_report.md
Most helpful comment
I have version
1.23.1and it still happens