Skip to content

Commit 838f081

Browse files
committed
fix doc example
1 parent d0f012f commit 838f081

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

guides/schema/instrumentation.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,19 @@ class MyFieldInstrumentation
3030
old_resolve_proc.call(obj, args, ctx)
3131
Rails.logger.info("#{type.name}.#{field.name} END: #{Time.now.to_i}")
3232
}
33+
34+
# Return a copy of `field`, with a new resolve proc
35+
field.redefine do
36+
resolve(new_resolve_proc)
37+
end
3338
end
3439
end
3540
end
3641
```
3742

3843
It can be attached as shown above. This implementation will _modify_ the underlying `GraphQL::Field` instance... be warned!
3944

40-
## Query Instrumetation
45+
## Query Instrumentation
4146

4247

4348
Query instrumentation can be attached during schema definition:

0 commit comments

Comments
 (0)