phoenix-graphql

Write efficient GraphQL queries against the Phoenix API for trace, dataset, and experiment analysis.

11.3k|1.1k|Updated Nov 9, 2022
One-click install
npx skills add https://github.com/Arize-ai/phoenix --skill phoenix-graphql
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: phoenix-graphql
Source: https://github.com/Arize-ai/phoenix/tree/main/src/phoenix/server/agents/prompts/skills/phoenix-graphql
Command: npx skills add https://github.com/Arize-ai/phoenix --skill phoenix-graphql

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Writing GraphQL queries against the Phoenix API without schema knowledge leads to failed lookups, full introspection round trips, and inefficient queries. This Skill provides the schema entrypoints, entity field references, and query patterns needed to answer data questions or build integrations against Phoenix without introspecting the schema.

Core Features & Use Cases

  • Schema entrypoints and lookup rules: Covers node(id:) global lookups, Relay connections with filters, and the exact by-name/by-id helpers that exist, including which helpers do not exist (e.g. no getDatasetByName).
  • Per-entity reference files: Detailed field references for projects, spans, traces, sessions, datasets, experiments, prompts, and annotations, loaded on demand.
  • Efficiency and pagination patterns: Relay pagination, query variables, aliased batching, truncated span payloads, and the span/session filter DSL.
  • Use Case: Ask which LLM spans errored in the last hour, and the Skill produces a filtered Project.spans query with filterCondition: "span_kind == 'LLM' and status_code == 'ERROR'" ready to run via phoenix-gql or curl.

Quick Start

Ask the agent to write a GraphQL query that lists the 20 slowest root spans in a Phoenix project, and it will load this skill and return a ready-to-run query with variables and pagination handling.

Frequently Asked Questions about phoenix-graphql

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I query Phoenix traces with GraphQL?

Query traces via Project.spans with rootSpansOnly set to true, which returns one root span per trace. There is no traces connection on Project; use the trace { traceId } nested field on a span or Project.trace(traceId:) for OTel hex ID lookups.

How do I look up a Phoenix dataset or prompt by name?

There is no getDatasetByName or getPromptByName helper in the Phoenix GraphQL schema. Use the datasets or prompts connection with a filter argument to find the entity by name, or fetch it directly with node(id:) if you have its Relay global ID.

How do I authenticate GraphQL requests to the Phoenix API?

Send a Phoenix API key as a bearer token in the Authorization header to POST <phoenix-endpoint>/graphql with a JSON body containing query and variables. API keys are created in Phoenix settings, and a GraphiQL IDE is served on GET at the same path.

How do I filter spans by annotation or status in Phoenix?

Use the filterCondition argument with the Python-like filter DSL, for example status_code == 'ERROR' or annotations['Hallucination'].label == 'hallucinated'. Trace-level annotations are referenced as trace_annotations['name'].label, and clauses combine with and/or.

Should I use the Phoenix GraphQL API or the REST API?

The GraphQL schema is designed primarily for the Phoenix UI and may change between versions. For stable programmatic access, prefer the REST API at /v1/... and the arize-phoenix-client Python or @arizeai/phoenix-client TypeScript packages where they cover the need.

Why is my Phoenix span query returning huge payloads?

Span input and output fields can contain full LLM payloads. Request input { truncatedValue } to get only the first 100 characters when surveying spans, and fetch the full value field only for spans you intend to read closely.