@@ -3,6 +3,8 @@ title: Using Directives in GraphQL.js
33sidebarTitle : Using Directives 
44--- 
55
6+ # Using Directives in GraphQL.js  
7+ 
68Directives let you customize query execution at a fine-grained level. They act like
79annotations in a GraphQL document, giving the server instructions about whether to
810include a field, how to format a response, or how to apply custom behavior.
@@ -178,9 +180,9 @@ a resolver.
178180## Implementing custom directive behavior  
179181
180182GraphQL.js doesn't execute custom directive logic for you. You must handle it during
181- execution. There are two common approaches:  
183+ execution. There are two common approaches:
182184
183- 1 .  Handle directives in resolvers
185+ ###  1. Handle directives in resolvers 
184186
185187Inside a resolver, use the ` info `  object to access AST nodes and inspect directives.
186188You can check whether a directive is present and change behavior accordingly.
@@ -229,7 +231,7 @@ console.log(result);
229231//  → { data: { greeting: 'HELLO, WORLD' } }
230232` ` ` 
231233
232- 2. Use AST visitors or schema wrappers 
234+ ###  2. Use AST visitors or schema wrappers
233235
234236For more complex logic, you can preprocess the schema or query using AST visitors or wrap 
235237field resolvers. This lets you inject directive logic globally across 
0 commit comments