Skip to content

Standardize naming for "Schema Coordinates" (e.g. Foo.bar) #735

Open
@magicmark

Description

@magicmark

Update: RFC PR is here! #746


For example, given this schema:

type Business {
    reviews: [Reviews]
    name: String
}

type Review {
    body: String
    ...
}
  • Business.name uniquely identifies the "name" field on the "Business" type
  • Business.reviews uniquely identifies the "reviews" field on the "Business" type
  • Review.body uniquely identifies the "body" field on the "Review" type

We intuitively understand what this dot separated string means, but I can't find anything anywhere that formalizes its definition, or what it's even called.

I'll go with "type/field pair" for now since I vaguely remember seeing that somewhere (but can't remember where)

Why do we want this?

Various tooling wants to show field coordinates - usually for documentation or metrics/tracking purposes.

Examples:

  • GraphiQL's documentation tab search bar showing field coordinates to uniquely identify fields:

  • GraphQL Inspector (840 stars) displays field coordinates in its output:

  • And internally at Yelp, we want to show a list of "most popular fields in the schema" - using field coordinates is a good way to track this!

The ask

Being able to communicate what this strange dot separated string means would be useful to folks onboarding, and it'd be great to standardize this and point to something in the spec/official docs.

Does this worth standardizing and including in the docs?

Thanks!

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