GithubHelp home page GithubHelp logo

Comments (3)

kitten avatar kitten commented on June 3, 2024

I'm actually not sure it's appropriate for us to support this. To be honest, what stops any given GraphQL HTTP API to implement any response code or shape they want? Especially in this case, Contentful has decided to namespace the error code under a custom extension key, instead of following the defacto standard.

This is even more odd in my opinion based on their request input shape following the defacto spec.

Overall, most APIs currently follow the defacto spec, and until a spec is ratified and implemented by the GraphQL over HTTP spec extensions, I don't think there's a good argument to be made for implementing arbitrary spec divergences in the urql repo.

There's of course an argument to be made for these functions to be configurable:

const isPersistedMiss = (error: CombinedError): boolean =>
error.graphQLErrors.some(x => x.message === 'PersistedQueryNotFound');
const isPersistedUnsupported = (error: CombinedError): boolean =>
error.graphQLErrors.some(x => x.message === 'PersistedQueryNotSupported');

However, again, this hasn't happened because we for now have a defacto spec, and there's no point in diverging from it just sometimes.

So, for now, I can only offer you to please "fork" @urql/exchange-persisted, or rather vendor the exchange into your codebase with the necessary changes

Hope that makes sense to you. Happy to answer more questions about it, but I think for now let's put the PR on hold and I don't think there'll be much movement in urql re. APQ support unless a new spec arises for it in GraphQL over HTTP

from urql.

soleo avatar soleo commented on June 3, 2024

Thanks @kitten for your comment. We also submitted support ticket for Contentful to take a look to align with popular GraphQL client out there, e.g Relay, ApolloClient. For now, we will use my own fork.

It would be nice that the error could be part of graphQL spec though.

from urql.

JoviDeCroock avatar JoviDeCroock commented on June 3, 2024

I am going to close this out as it's basically a vendor-specific ask 😅

from urql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.