Skip to content

Glossary request: inner vs unwrapped types #831

@benjie

Description

@benjie

In the GraphQL spec we refer to these terms:

  1. unwrapped nullable type
  2. unwrapped item type
  3. unwrapped type
  4. inner item type
  5. inner type

They seem to have subtly different meanings:

  • inner type - for a non-null or list variant, this is the type that the non-null or list wraps (which may itself be a non-null or list).
  • inner item type - as inner type but only applies to list variants
  • unwrapped type - I believe this means the same as inner type, though I could be wrong and it might mean the underlying named type. This term is only used in https://spec.graphql.org/draft/#sec-Input-and-Output-Types and both interpretations will get you the same result (through slightly different paths).
  • unwrapped nullable type - for a non-null variant, this means the inner type; for all other types it is the unchanged type
  • unwrapped item type - for a list variant, this means the inner type; for all other types it is the unchanged type

I, personally, think it would be better to just use inner type throughout and make the "if it is a non-null variant then the inner type otherwise the type" meaning explicit. However, a step up over the current situation would be to have a glossary explaining these terms.

If there's more subtlety to the differences between these terms I'd love to understand it.

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