What will happen if the schema uses a deprecated field without a description?
medium
A. Linting will pass without errors
B. Linting will report errors for both deprecated field and missing description
C. Linting will only check for missing descriptions
D. Linting will ignore deprecated fields
Solution
Step 1: Analyze linting rules
"no-deprecated-fields": true means deprecated fields cause errors. "require-description": true means missing descriptions cause errors.
Step 2: Apply rules to schema case
Schema has a deprecated field without description, so both rules trigger errors.
Final Answer:
Linting will report errors for both deprecated field and missing description -> Option B
Quick Check:
Both rules active = errors for both issues [OK]
Hint: Active lint rules cause errors for matching schema issues [OK]
Common Mistakes:
Assuming lint ignores deprecated fields
Thinking only one rule applies
Believing missing description is allowed
4. You run a schema linter and get an error: Field 'userAge' is missing a description. Which fix will resolve this error?
medium
A. Add a description string above the 'userAge' field in the schema
B. Rename the field to 'ageUser'
C. Remove the 'userAge' field from the schema
D. Ignore the error and continue
Solution
Step 1: Understand the error meaning
The error says the field lacks a description, so the linter expects a comment or description string.
Step 2: Choose the fix that adds description
Adding a description string above the field satisfies the linter. Renaming or removing the field or ignoring the error does not fix the missing description.
Final Answer:
Add a description string above the 'userAge' field in the schema -> Option A
Quick Check:
Missing description = add description [OK]
Hint: Add descriptions as comments to fix missing description errors [OK]
Common Mistakes:
Renaming field instead of adding description
Deleting field unnecessarily
Ignoring lint errors
5. You want to enforce that all GraphQL schema types have descriptions and no unused types exist. Which combined linting configuration achieves this?
hard
A. { "require-description": true, "no-unused-types": true }
B. { "allow-unused-types": true, "require-description": false }
C. { "no-deprecated-fields": true, "allow-unused-types": false }
D. { "require-description": false, "no-unused-types": false }
Solution
Step 1: Identify rules for descriptions and unused types