Pluralsight: Building a GraphQL API with Apollo Server 2020 Flashcards
03 Resolving Queries / 04 Field Level Directives
3 Field Level Directives
- @include
- @skip
- @deprecated
05 Mutating Data / 02 Modifying Data
Can query and mutations go in one request togehter?
No, they need to go separately.
Graphiql or Apollo playground doesn’t support it, but official documentation say that it could be possible in multi-operation documents.
05 Mutating Data / 03 Input Types
Is this correct
addNewSession(session: Session): Session
No, param session must be Input rather than Type
05 Mutating Data / 04 Enums
How to create mapping between Enum and internal model?
Just create resolver for GraphQL enum.
In object {ENUM: ‘mappedValue’} key is GraphQL enum wheras ‘mappedValue’ is a value from internal model.
06 Error Handling and Validation / 02 Built-in Error Handling
Assuming that Session contains Speakers who are taken via REST endpoint that doesn’t work. What will be returned for:
query {
sessions {
title
id
speakers {
name
}
}
}
- n errors for every session (errors section)
- n sessions with speakers = null (data section)
06 Error Handling and Validation / 05 Union
What is a Union?
It is a construction allowing to return two (or more) different types. Can be used to discard error section and return error or data in data section of the response.
07 Working with Apollo Studio / 01 Introduction
What is able to do with Apollo Studio?
Register schemas and monitor usage.