Using the same "GraphQL Type Name"s produces data issues
Hello! First of all, thanks for the great plugin, loving the push.
I found that when setting the same "GraphQL Type Name" for different "Field groups" ie.:
(meaning I have many others set as "acf" too)
.. then all of a sudden when querying my entity's acf property, I seem to get access to all other acf properties' from other entities:
.. and to prove that those properties aren't in my rutinas entity:
--
Is this a bug? Or am I misuing the "GraphQL Type Name"? I found it very annoying to have to access the data for each object by specifying the entity name every time. To make things worse, when attempting to "save" data via the REST API (as mutations aren't yet supported), then the field must be named acf, hence why I thought I'd kill 2 birds with 1 stone if I just set them all to be acf in the first place.
Any ideas on how to fix/improve on the above?
@alecarg it looks like you're using the new WPGraphQL for ACF v2.*+?
I'm going to transfer this issue to the repo where that plugin is maintained.
I found it very annoying to have to access the data for each object by specifying the entity name every time
@alecarg this is how GraphQL works. You are explicit about the Types and Fields that you want to consume as an API consumer.
GraphQL cannot have duplicate Types of the same name, so by assigning multiple ACF Field Groups the type name "acf" it creates a conflict. (Similar to if you tried to register multiple post types with the name "post", you would have issues as well).
I think the real bug here is that the ACF UI doesn't have validation preventing you from saving a GraphQL field group and assigning it a GraphQL Type Name that already exists. (see: #87)
Closing in favor of #87