GraphQL API Playground
You can see how to access the GraphQL Playground on the GraphQL API first steps documentation.
access graphql playgroundYou can use the playground to run queries or to explore how to build them. If you’re just starting, you can copy and paste these queries on the playground and discover what each field represents, available operators, and even get real-time validation for erros.
This first query is a type of introspection query, which provides information on fields for datasets:
query IntrospectionQuery { __schema { queryType { name } mutationType { name } subscriptionType { name } types { ...FullType } directives { name description locations args { ...InputValue } } }}
fragment FullType on __Type { kind name description fields(includeDeprecated: true) { name description args { ...InputValue } type { ...TypeRef } isDeprecated deprecationReason } inputFields { ...InputValue } interfaces { ...TypeRef } enumValues(includeDeprecated: true) { name description isDeprecated deprecationReason } possibleTypes { ...TypeRef }}
fragment InputValue on __InputValue { name description type { ...TypeRef } defaultValue}
fragment TypeRef on __Type { name ofType { kind name ofType { kind name ofType { kind name ofType { kind name ofType { kind name ofType { kind name ofType { kind name } } } } } } }}
This second query uses the httpMetrics dataset, with edge application data:
query HttpCalculatedDataTransferred { httpMetrics( limit: 2000 filter: { tsRange: {begin:"2023-01-26T10:00:00", end:"2023-01-26T20:00:00"} } groupBy:[ts] orderBy:[ts_ASC] ) { ts dataTransferredIn dataTransferredOut dataTransferredTotal }}
You can also modify fields and values to explore how GraphQL API and the playground work.
Contributors