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 a way to disable "Missing field X" message (and definitely do not throw an error)

See original GitHub issue

This is in regards to:

https://github.com/apollographql/apollo-client/blob/dbbd4dd9983f878e114378a9997e70df0f565b7b/src/data/writeToStore.ts#L202-L207

I am intentionally not providing fields to apollo-client. See graphql-deduplicator to understand the motivation. This strategy to reduce the size of the GraphQL response from 1.5MB to just under 100KB.

Whats the reason apollo-client is warning about this in the first place?

Alternatively, suppose that you are planning to remove this feature, does the network middleware allow to intercept the response before it is being interpreted by writeToStore.ts?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
SachaGcommented, Sep 24, 2017

For some reason I’m seeing this error for queries that shouldn’t return the field that’s missing. In other words I might get a Missing field CommentsList message for a query that doesn’t target that resolver at all.

3reactions
cesarsolorzanocommented, May 24, 2017

A GraphQL result with a shape different to the requested query it’s not compliant with the GraphQL specification.

However, perhaps you could use a custom network interface (which reconstructs the result data) so you provide a complete graphql-compliant response to apollo-client.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solved: Include the Missing Fields in Error Response
Solved: Hi, I just want to include the fields that are null in my error response. Any suggestion? Sample request { "username": ""...
Read more >
How to fix "The following module is missing from the file ...
Make sure that the "missing" module has been removed from your installation profile's . info file (usually as a dependency).
Read more >
How do I create a custom Error in JavaScript? - Stack Overflow
This confirmes the "problem" I ran into was the stack property of the error was the line number where new Error() was created,...
Read more >
Get Started with Custom Error Handling in Spring Boot (Java)
Learn how to implement custom error handling logic in Spring Boot. You will see two approaches based on the @ControllerAdvice annotation.
Read more >
Warning Options (Using the GNU Compiler Collection (GCC))
Warnings are diagnostic messages that report constructions that are not ... Disabling the error for this warning can result in poorly optimized code...
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