Schema#

Schema data structure module

This module contains various data structures in the form of dataclasses that are used to represent GraphQL schemas in Subgrounds using an AST-like approach.

class subgrounds.schema.SchemaMeta(*, queryType, types, type_map=None, mutationType=None, subscriptionType=None)#

Class representing a GraphQL schema.

Contains all type definitions.

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

type_of_typeref(typeref)#

Returns the type information of the type reference typeref

Parameters:

typeref (T) -- The type reference pointing to the type of interest.

Raises:

KeyError -- If the type reference refers to a non-existant type

Returns:

Type information

Return type:

subgrounds.schema.TypeMeta.ScalarMeta | subgrounds.schema.TypeMeta.ObjectMeta | subgrounds.schema.TypeMeta.EnumMeta | subgrounds.schema.TypeMeta.InterfaceMeta | subgrounds.schema.TypeMeta.UnionMeta | subgrounds.schema.TypeMeta.InputObjectMeta

type_of(tmeta)#

Returns the argument or field definition's underlying type

type_of_input_object_meta(tmeta, args)#

Recursively finds the nested type