kensho-technologies/graphql-compiler

Dealing with vertex types and edge types with invalid names

Opened this issue · 0 comments

When reflecting the GraphQL schema from a database, we ignore properties with invalid names because GraphQL core will raise an error if any of the GraphQL types has an invalid name. However, do not ignore vertex types and edge types with invalid names.

It would be ideal if we could implement a fix that would solve this issue for all the different possible backends. Ideally, in a pre-processing step that happens when the SchemaGraph is being built. However, the SchemaElement objects are all immutable and there are connections between them.
So removing SchemaElement objects in a pre-processing step might require a larger refactor.

In the future, we might also want to implement a function that attempts to sanitize the names by removing invalid characters instead of ignoring them.

An edge type/vertex type name is invalid if it doesn't match
graphql.utilities.assert_valid_name.re_name