Skip to content

Question: does global declaration need to be kept #172

Open
@Moumouls

Description

@Moumouls

Hello,

We have recently upgraded to the latest version (4.X) of the graphql-request package. Additionally, we are utilizing an older version of GraphQL Yoga v2.

During this process, we encountered a type conflict error. This was due to an older version of @whatwg-node/fetch that declared the same global as this package.

declare const _fetch: typeof fetch;
declare const _Request: typeof Request;
declare const _Response: typeof Response;
declare const _Headers: typeof Headers;
declare const _FormData: typeof FormData;
declare const _AbortController: typeof AbortController;
declare const _ReadableStream: typeof ReadableStream;
declare const _WritableStream: typeof WritableStream;
declare const _TransformStream: typeof TransformStream;
declare const _Blob: typeof Blob;
declare const _File: typeof File;
declare const _crypto: typeof crypto;
declare const _btoa: typeof btoa;
declare const _TextEncoder: typeof TextEncoder;
declare const _TextDecoder: typeof TextDecoder;
declare const _Event: typeof Event;
declare const _EventTarget: typeof EventTarget;

Fortunately, we noticed that in the newer version of @whatwg-node/fetch, they have removed the global declaration. This change helps avoid conflicts with this library. However, I'm wondering if it might be a good idea for this library to also remove the global declaration to prevent potential conflicts with other libraries.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions