The nullable order field contains a Non-Null total that resolves to null. What does resul…

from GraphQL
Node 24 intermediate 2 min

The nullable order field contains a Non-Null total that resolves to null. What does result.data contain?

JavaScript
const { buildSchema, graphql } = require("graphql");
const schema = buildSchema(`
  type Order { id: ID!, total: Int! }
  type Query { service: String!, order: Order }
`);
const result = await graphql({
  schema,
  source: `{ service order { id total } }`,
  rootValue: { service: "shop", order: { id: "o1", total: null } },
});
console.log(JSON.stringify(result.data));
Open in playground
Report an error