Skip to content

envio serve must honor the @internal entity directive #1569

Description

@DenhamPreen

#1568 adds @internal on entities in schema.graphql: the entity keeps its Postgres table and handler API but is excluded from Hasura tracking (no queries, permissions, or relationships).

envio serve (branch claude/rust-graphql-envio-serve-1g12vr, not yet on main) builds its GraphQL surface by leniently parsing schema.graphql itself — packages/cli/src/serve/project_schema.rs collects every object type as an entity. Since an @internal entity's Postgres table exists, serve would expose it, breaking parity with Hasura and defeating the directive's purpose (hiding sensitive/internal state from the API).

When the serve branch rebases on main it needs to:

  • Skip entities carrying @internal in ProjectSchema::parse.
  • Drop relationships that point at a skipped entity (codegen rejects exposed→internal references for schemas built by a CLI that knows the directive, but serve tolerates any schema version, so filter defensively).
  • Add a differential-corpus case asserting an @internal entity is absent from introspection and queries error the same way as for an unknown table in Hasura.

🤖 Generated with Claude Code

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