You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ApiClient's types indicate that a fetch implementation may be provided in the config argument for delete(), fetch() and mutate(). The ApiClient does not use this implementation. Instead it always uses the fetch which was provided to the constructor.
My use-case is that I'd like to hook "fetch" to intercept request/response data in the manner suggested by #38 (comment)
The text was updated successfully, but these errors were encountered:
Yeah I'm noticing now that the declared types were implemented incorrectly - the config argument for the client constructor is being portrayed as the same as that for the delete/fetch/mutate methods, as you noted.
That being said, would you mind expanding on how providing a custom implementation to the client constructor does not fit your use case, i.e. what does also supporting it at the method level enable?
Sure. Firstly, my project is only using the JSON API client part of jsonapi-react, not the caching part. The JSON API implementation my project uses (https://www.graphiti.dev/) supports some extended functionality beyond what JSON API provides as standard. As such I want to be able to modify the request body, while still retaining the ability to parse the response using jsonapi-react.
I've actually achieved this by putting a replaceBody function on the fetchOptions when calling mutate and providing a fetch implementation which uses fetchOptions. This works, but it seems like a fairly convoluted way of doing this.
Considering all of the use cases my project has, the thing which would really make me happy is a library with just your serialiser and deserialiser in it. Yours is the only (de)serialiser project I've found which actually works with deeply nested relationships (good job on that!). We need to be able to deserialise the data in both the browser (a React application) and NodeJS. Having access to your simple and reliable serialiser library would enable us to do this quite easily.
ApiClient's types indicate that a fetch implementation may be provided in the config argument for delete(), fetch() and mutate(). The ApiClient does not use this implementation. Instead it always uses the fetch which was provided to the constructor.
My use-case is that I'd like to hook "fetch" to intercept request/response data in the manner suggested by #38 (comment)
The text was updated successfully, but these errors were encountered: