Skip to content

Use global fetch if in browser environment, else use cross-fetch#23

Open
njerig wants to merge 13 commits into
Michigan-Tech-Courses:masterfrom
njerig:master
Open

Use global fetch if in browser environment, else use cross-fetch#23
njerig wants to merge 13 commits into
Michigan-Tech-Courses:masterfrom
njerig:master

Conversation

@njerig

@njerig njerig commented Apr 3, 2023

Copy link
Copy Markdown
Contributor

isomorphic-fetch uses the same browser polyfill as cross-fetch and therefore shouldn't be used if graphql-request already uses cross-fetch. Instead, we check to see whether the global fetch defined in browsers exists. If it does, we use it; if it doesn't, we use cross-fetch.

Resolves: #17
Related pull request that was never merged: lquixada/cross-fetch#138

njerig added 3 commits April 3, 2023 01:07
isomorphic-fetch uses the same browser polyfill as cross-fetch and
therefore returns the same error. isomorphic-fetch will be removed
as a dependency in the next commit.

Related pull request that was never merged: lquixada/cross-fetch#138
Comment thread src/index.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Using this module in a Chrome extension

2 participants