common_graphql_client v0.5.0 mix graphql.validate_query View Source
Mix task to call static query validator
Link to this section Summary
Link to this section Functions
This method is the entry point to mix graphql.validate_query task.
It validates a graphql query against a given schema
Example:
# When query is valid
iex> schema_path = "./test/support/example_schema.json"
iex> schema_string = File.read!(schema_path)
iex> query_string = "{ __schema { types { name } } }"
iex> Mix.Tasks.Graphql.ValidateQuery.run(["-s", schema_string, query_string])
:ok