Skip to content

Query variables: hover, autocomplete, and inline :setvars #16

@VGSML

Description

@VGSML

Summary

Improve the developer experience for working with GraphQL query variables in the notebook by adding editor intelligence (hover tooltips, autocompletion) for variable types and values.

Scope

1. Hover and autocomplete for variable types in queries

  • When a query declares variables (e.g. $id: ID!, $filter: SomeInput), provide hover tooltips showing type details and autocomplete for type names.

2. Inline :setvars in the same cell as the query

  • Allow writing :setvars after the query in the same cell, so variables and the query live together without switching cells.

3. Editor intelligence for :setvars values (when query is in the same cell)

  • Autocomplete variable names (from the query's variable declarations).
  • Hover tooltips for variable names showing their declared type.
  • Autocomplete and validation for JSON values based on the variable's GraphQL type (e.g. suggest enum values, input object fields).

Notes

This needs careful design — the interaction between the GraphQL parser, meta-command parser, and JSON value context is non-trivial. Consider:

  • How to detect the boundary between the GraphQL query and :setvars in a single cell
  • How to map variable declarations to their usage in :setvars
  • How to provide type-aware JSON completions (enums, input objects, scalars)

Labels

Backlog / Enhancement


🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions