[BREAKING] Fix(GRAPHQL): Don’t generate get query on interface if it doesn’t have field of type ID and also disallow get query on field of type @id in inerface. (#7158) (#7305)
We use uuids for every object, also for interfaces.
interface Foo {
id: String! @id
}
And we rely on setting these IDs from the client due to synchronization mechanics. This is not possible with id: ID!
Can you please re-enable the query generation when @id type only exists on the interface? Or tell us how we should move forward?
[…] in cases when interface is implemented by multiple types […]
But this is always the case with interfaces. Otherwise you wouldn’t have to use interfaces in the first place.
In my opinion, instead of disallowing the query generation, you should rather make sure that all implementing types have unique ids when they are added and return an error to the client.
On another note, it would be good if you communicate such breaking changes in advance such that people can react to it and give feedback.
Edit:
For a workaround I guess I could just use both ID and @id. And for the get query I’ll have to use ID. This is not ideal, but I think it works.
So, we are not generating get query for the interface if it doesn’t have an ID type but we are still generating Filter Query for it. If possible can you please change get queries on interfaces that uses @id directive to filter queries as mentioned in attached post.
query{
queryFoo(filter: {id:{eq: "dgraph"}}){
id
}
}