question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add simple way to disable @defer support

See original GitHub issue

It doesn’t appear like there’s any (simple) way to disable @defer support. @defer support when writing a GraphQL server needs special treatment to send the deferred paths to the client, and in the event that this is not put in place in the code that uses GraphQL-Java, it should be possible to (easily) disable @defer support at the engine level (by ignoring @defer in queries, or failing to validate them).

For now, I can think of only one way to implement this, which is by writing my own instrumentation to either rewrite the Document and/or OperationDefinition to remove @defer in instrumentExecutionContext, or to reject @defer usage altogether in beginValidation (for that case, it might also be possible to make sure the GraphQLSchema does not contain the Directives.DeferDirective; when using SchemaGenerator, this requires duplicating the built schema to remove the directive).

Such instrumentations (or any other way of disabling @defer) should IMO be provided out of the box by GraphQL-Java. WDYT?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
bbakermancommented, Mar 14, 2019

@defer is not longer on by default in master (which will be released in 13.0 at some stage)

0reactions
dinhanicommented, Oct 20, 2019

After finding this example, the following line enabled it again.

schema.transform(builder -> builder.additionalDirective(Directives.DeferDirective));

Read more comments on GitHub >

github_iconTop Results From Across the Web

Enable/disable defer loading of JavaScript - Knowledge Base
Why JavaScript should be deferred? When JavaScript should not be deferred? Before turning on JavaScript Optimization; How to toggle JavaScript optimization?
Read more >
9 tricks to eliminate render blocking resources - LogRocket Blog
1. Identify your render blocking resources · 2. Don't add CSS with the @import rule · 3. Use the media attribute for conditional...
Read more >
Ability to disable "defer media playback in background tabs."
To disable it, go to chrome://flags/#disable-gesture-requirement-for-media-playback and click "Enable". Restart Chrome and it should work!
Read more >
JS Defer is OFF but still defers | WordPress.org
Hi,. I have turned off LiteSpeed Cache JS Defer feature, but I still get script types rewritten to “litespeed/javascript” randomly.
Read more >
Defer Attribute (Chrome) - javascript - Stack Overflow
The simplest way to have the page render before the scripts execute, ... then simply add defer="defer" in your tag and that will...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found