Open ttstauss opened 2 years ago
Thanks for reporting this, @ttstauss! I'm able to reproduce this now.
I've found two separate issues:
DUPLICATE_TYPE
warning with a “You cannot register duplicate Types to the Schema” message. (I can reproduce the error you describe without changing the model name.)We'll look into some fixes. Until then, the workarounds are to:
DUPLICATE_TYPE
messages in debug output. (They are warnings and should not impact query results.)@nickcernis, thanks for looking into this. We'll revert to the original Singular/Plural modal names for now.
Looking forward to a fix. Thanks!
As of ACM 0.18.0 (out now) it should now be possible to change the name of a model without relationships resolving as null.
I'll leave this open until we fix the DUPLICATE_TYPE
warnings too, though, which should not impact behavior but should still be resolved. (Note for team: we're tracking this internally at https://wpengine.atlassian.net/browse/MTKA-1543.)
When creating a model that has two very similar relationship fields set up (i.e. a one to many and a many to many to the same model), graphql returns the following error AFTER the model name is updated:
You cannot register duplicate Types to the Schema. The Type '[NameOfField]ConnectionEdge' already exists in the Schema. Make sure to give new Types a unique name.
To reproduce
null
(if you turn on debugging you see the error from above).Here's an example query:
And an example result:
Expected behavior
The query should still work even after the model name is changed.
Screenshots
Version information
Additional context