graphql-engine icon indicating copy to clipboard operation
graphql-engine copied to clipboard

Track all "id_unique" in the GraphQL schema because it is not a valid

Open HT-Moh opened this issue 2 years ago • 3 comments

I restored the database using Prisma, and once I go to Hasura and click Track all got the following error

cannot include "accounts.compound_id_unique" in the GraphQL schema because it is not a valid GraphQL identifier.

image

The workaround which far from ideal. I removed all unique from the schema, push the schema once again and then track all, and once again I need to put unique back.

Is there any solution for this problem?

Hasura: v2.0.9

HT-Moh avatar Sep 14 '21 09:09 HT-Moh

Regarding the workaround: Do I have to DROP and CREATE constraints for each database? I won't be able to do that on production...

Is there an ETA for a fix?

(I don't even want to track all, but I want to track a table that has a unique constraint. Which does not seem like very unusual use case to me...)

some-user123 avatar Oct 10 '22 06:10 some-user123

Is this a duplicate of #7850?

BenoitRanque avatar Oct 12 '22 18:10 BenoitRanque

@some-user123 you do not need to drop and create the constraint, instead you can rename them like this:

ALTER TABLE "schema_name"."table_name" RENAME CONSTRAINT "constraint_name" TO "new_constraint_name";

BenoitRanque avatar Oct 13 '22 00:10 BenoitRanque

I have the same problem but with a - inside of an index name (hasura 2.13.0)

I am unable to rename the offending constraint because it's not my database

jflambert avatar Oct 19 '22 16:10 jflambert