GraphQL: getting started

Lesson 06 · 12 min

enum, input, interface, union

Types that make a schema precise: limited values, input objects, shared fields.

12 minLesson 6 of 9Practice includedAsk AI on any point

enum limits a field to a list of values. input is an object for arguments: a regular type can't be used in arguments. interface describes shared fields that several types have. union says "one of these types here" with no shared fields. To get the fields of a specific type from an interface or union, a query uses an inline fragment ... on Book, and __typename tells you what came back.

Sign in to continue

The rest of this lesson opens after sign up

The first lesson of every course is open without an account. To read on, solve the practice and use Ask, create a free account or log in.