mirumee / ariadne

Python library for implementing GraphQL servers using schema-first approach.

Home Page:https://ariadnegraphql.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update GraphQL fixing logic

rafalp opened this issue · comments

Ariadne should export two utility functions:

  • validate_schema_enum_values(schema: GraphQLSchema) to raise validation errors on invalid enum members.
  • repair_default_enum_values(schema: GraphQLSchema) to walk the schema and fix default_value on all places where enum arg or input field has default value set, because graphql-core sets it to string.

We could also drop set_default_enum_values_on_schema from Ariadne because graphql-core now defaults to setting enums default values after their members names.

I've already implemented universal tests suite for catching issues in our GraphQL enum handling, I will use it while working on this issue.