Comments (7)
It works if I use window.location.origin
since I'm using it in browser only.
from graphql-request.
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.
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.
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.
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.
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.
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)
- Create separated npm package for CLI functionality HOT 8
- Please give feedback to the GraphQL JS WG HOT 2
- 7 doesnt work on nextjs HOT 4
- 7 broken on Expo/RN project HOT 1
- TypeScript doesn't recognize the types and fail v7 HOT 1
- Document the requirement of tooling support for package.exports HOT 8
- [7.0.1] broken types HOT 16
- Graffle helper functions
- Extension system
- TypedDocumentNode support
- Support GET requests
- Add support for NextJS revalidate/tags directly from request HOT 2
- investigate quality tools HOT 1
- Types broken in v7 HOT 2
- Extension that can retry a hook HOT 2
- Cannot find module 'graphql-request' or its corresponding type declarations. HOT 11
- Error: Could not convert argument of type symbol to string. HOT 1
- Spreading request headers object in middleware function doesn't work as per examples HOT 2
- Extend graphql return mode to include the response when transport is http
- Typescript cannot find type `RequestOptions` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphql-request.