QuickDevGuide

Home › GraphQL & gRPC

Queries, Variables, Fragments & Aliases — GraphQL & gRPC

Clients describe the exact shape of the response. Feature Purpose Operation name query DashboardData { ... } — shows up in logs and tooling Variables query ($id: ID!) + JSON variables — never string-concatenate values Aliases fetch the same field twice: admins: users(role: ADMIN) Fragments reuse selections: ...UserCard Inline fragments select fields per type on unions/interfaces: ... on Post { title } Directives @include(if: $withPosts), @skip(if: ...) typename which concrete type was returned Everything is sent as a POST to a single endpoint (usually /graphql) with { "query", "variables", "operationName" }.

Key Takeaways