Skip to content

gen-graphql: no root operation type is emitted, so the generated document is not servable #64

Open

Description

@jdsika

GraphqlGenerator emits type definitions only. It names no root operation type, which a schema has to provide (GraphQL spec, October 2021, §3.3.1), so the generated document describes a type system but is not servable.

Reproduce on any schema:

uv run gen-graphql tests/linkml/test_generators/input/kitchen_sink.yaml

The output has no type Query, and validate_schema reports Query root type must be provided.

LinkML already carries tree_root, so the root class is known. What is not decided is the shape of the generated query fields: a single field returning a list, a field per class, identifier arguments, and whether anything is emitted at all when no class sets tree_root. That is a design decision rather than a bug fix, which is why #63 leaves it out and documents it under "Known gaps".

Downstream projects work around it by owning the whole generation pass, which also duplicates the object-type and enum emission that the generator already does correctly.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions