Pluralsight: Building a GraphQL API with Apollo Server 2020 Flashcards

1
Q

03 Resolving Queries / 04 Field Level Directives

3 Field Level Directives

A
  1. @include
  2. @skip
  3. @deprecated
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

05 Mutating Data / 02 Modifying Data

Can query and mutations go in one request togehter?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

05 Mutating Data / 03 Input Types

Is this correct

addNewSession(session: Session): Session

A

No, param session must be Input rather than Type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

05 Mutating Data / 04 Enums

How to create mapping between Enum and internal model?

A

Just create resolver for GraphQL enum.

In object {ENUM: ‘mappedValue’} key is GraphQL enum wheras ‘mappedValue’ is a value from internal model.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

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
}
}
}

A
  1. n errors for every session (errors section)
  2. n sessions with speakers = null (data section)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

06 Error Handling and Validation / 05 Union

What is a Union?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

07 Working with Apollo Studio / 01 Introduction

What is able to do with Apollo Studio?

A

Register schemas and monitor usage.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly