0

I define the following in Ariadne to inject into middleware:

type_defs = load_schema_from_path("schema.ql")
schema = make_executable_schema(type_defs, query,
                                snake_case_fallback_resolvers)

And if i run:

print(schema.__dict__) 

it returns:

{'_validation_errors': [], 'description': None, 'extensions': {}, 'ast_node': SchemaDefinitionNode at 0:27, 'extension_ast_nodes': (), 'query_type': <GraphQLObjectType 'Query'>, 'mutation_type': None, 'subscription_type': None, 'directives': (<GraphQLDirective(@include)>, <GraphQLDirective(@skip)>, <GraphQLDirective(@deprecated)>, <GraphQLDirective(@specifiedBy)>), 'type_map': {'Query': <GraphQLObjectType 'Query'>, 'artifactType': <GraphQLEnumType 'artifactType'>, 'model_inference': <GraphQLObjectType 'model_inference'>, 'String': <GraphQLScalarType 'String'>, 'params': <GraphQLInputObjectType 'params'>, 'Boolean': <GraphQLScalarType 'Boolean'>, '__Schema': <GraphQLObjectType '__Schema'>, '__Type': <GraphQLObjectType '__Type'>, '__TypeKind': <GraphQLEnumType '__TypeKind'>, '__Field': <GraphQLObjectType '__Field'>, '__InputValue': <GraphQLObjectType '__InputValue'>, '__EnumValue': <GraphQLObjectType '__EnumValue'>, '__Directive': <GraphQLObjectType '__Directive'>, '__DirectiveLocation': <GraphQLEnumType '__DirectiveLocation'>}, '_sub_type_map': {}, '_implementations_map': {}}

Is it possible to get my params object as a python dict or object so I can parse keys and values?

Happy Machine
  • 987
  • 8
  • 30

0 Answers0