GraphQL Content Delivery- type name collision helper
Release date: 4th October 2023Link copied!
The GraphQL type name collision helper allows developers to validate if a graph for a specific hub has been successfully published or not. Where it has not been successful, it allows the user to retrieve details of the errors that caused the failure. When the failure is due to a type name collision, it allows the user to retrieve a list of collisions they can address before attempting to generate a new version of the graph for that hub.
The GraphQL type name collision helper also aids with identifying all hubs that users have access to, including the hub IDs and other information.
Using the GraphQL type name collision helperLink copied!
If you are unable to view your hub’s graph, or the graph has not updated after a recent change to the content type schemas, the GraphQL type name collision helper allows you to confirm if the last attempt to generate the graph was successful or not. If it was not, it allows you to retrieve a list of errors that caused the failure.
The following example shows how the GraphQL type name collision helper can be used. In this example we use Insomnia to interact with the API.
Identifying type name collisions with the helperLink copied!
As shown in the screenshot below, we can see that our issue is a type name collision involving a banner and slot schema that have been given similar names.
Example responseLink copied!
"message": "A type with a duplicate name exists.",
Solving a type name collisionLink copied!
To solve this, we archive both schemas and create new ones that do not have similar names. When we query our new schema in the GraphQL playground we now get a response showing that the graph has been successfully built.
For more information on type name collisions and the different ways to fix them, see the GraphQL Content Delivery API overview.
Using the GraphQL type name collision helper, we also get a response informing us that building the graph was successful.