GraphQL - Coursera - pr1 Flashcards

1
Q

Which of the following modules allows cross-origin requests in ExpressJS?

cors
graphql-depth-limit
express-graphql
graphql

A

cors

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

We used several type definitions in our schema in this class. Which of the following is not a valid GraphQL schema?

object definitions
mutation
query
callback functions

A

callback functions

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

The part of the ExpressJS code that resolves a request to the actual data to be returned is called the:

schema
listener
port
resolver

A

resolver

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

Which of the following is a way to deter malicious query to be submitted and executed on the server?

Use faster server hardware
Use Linux for the server.
Use a web service to host the server
Limit query depth

A

Limit query depth

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

What can we do if we don’t want to convert a JSON object to the schema to be returned?

  • Use XML instead
  • Stringify the JSON object and serialize it.
  • Make the schema and the JSON object use the same signature, then we can just return the JSON object.
  • Use https instead of http.
A

Make the schema and the JSON object use the same signature, then we can just return the JSON object.

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

Which of the following code binds the schema to the resolver rootValue?

app. use(“/”, { schema: rootValue } ) );
app. use(“/”, (req, res) => { schema, rootValue } ;
app. use(“/”, schema, rootValue);
app. use(“/”, graphqlHTTP( { schema, rootValue } ) );

A

app.use(“/”, graphqlHTTP( { schema, rootValue } ) );

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