GithubHelp home page GithubHelp logo

Comments (7)

frederikhors avatar frederikhors commented on June 20, 2024 1

It works if I use window.location.origin since I'm using it in browser only.

from graphql-request.

jasonkuhrt avatar jasonkuhrt commented on June 20, 2024 1

I think being explicit here is less confusing and makes for a better API, because we can validate that a valid URL is passed catching more user errors.

Upon release, I'll try to remember to mention this breaking change!

from graphql-request.

jasonkuhrt avatar jasonkuhrt commented on June 20, 2024

If it only happens after you bundle then I think it's an issue in your project. What is the value of n.url? And, what is supplying the global URL?

from graphql-request.

frederikhors avatar frederikhors commented on June 20, 2024

Is the same URL I use with version v7.0.0-next.12.

graphql-request version is the only thing I change.

from graphql-request.

jasonkuhrt avatar jasonkuhrt commented on June 20, 2024

It might be a breaking change in graphql-request rather than a bug.

Does your target runtime (browser?) have a global URL class? What is the URL value? Have you manually run that value through the global URL class constructor?

from graphql-request.

frederikhors avatar frederikhors commented on June 20, 2024

browser?

Yes

Does your target runtime have a global URL class?

Nope, all default.

I'm using it like this with both versions:

export const client = new GraphQLClient("/graphql", {
	fetch: createPersistedQueryFetch(fetch) // from from https://github.com/jasonkuhrt/graphql-request/issues/269
});

from graphql-request.

jasonkuhrt avatar jasonkuhrt commented on June 20, 2024

Interesting, /graphql is not a valid URL. You are relying on the browser supplying the current host URL prefix. This approach is only valid in browsers. I'm not sure this feature should be supported, but I'll consider it. Let me know what you think for your use-case.

from graphql-request.

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.