Skip to Main Content
Advanced TypeScript Programming Projects
book

Advanced TypeScript Programming Projects

by Peter O'Hanlon
July 2019
Intermediate to advanced content levelIntermediate to advanced
416 pages
10h 6m
English
Packt Publishing
Content preview from Advanced TypeScript Programming Projects

Creating our GraphQL resolver

The TodoItem and TodoItemInput classes were aimed at giving us schemas that describe the fields, types, and arguments. While they are an important part of our GraphQL jigsaw, we have a missing piece—the ability to execute functions against our GraphQL server.

We need a way to resolve the fields of our types. With GraphQL, a resolver is something that represents a single field. It fetches the data that we need, effectively giving the GraphQL server detailed instructions on how to convert queries into data items (we can think of this as one of the reasons why we have separate schemas for mutating data over querying data—we cannot mutate fields using the same logic as querying fields). From this, we can work out ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learn TypeScript 3 by Building Web Applications

Learn TypeScript 3 by Building Web Applications

Sebastien Dubois, Alexis Georges

Publisher Resources

ISBN: 9781789133042Supplemental Content