Skip to content
This repository has been archived by the owner on Apr 15, 2020. It is now read-only.

Requiring apollo-link-http-common enforces dom to the tsconfig libs #41

Open
darkbasic opened this issue Feb 17, 2020 · 8 comments
Open

Comments

@darkbasic
Copy link

While graphql-tools doesn't explicitely require apollo-link-http-common, this fork does.
The downside of this is that you won't be able to compile your application anymore unless you add dom to your tsconfig libs: apollographql/apollo-link#544
Why would I need to add dom to all my node.js applications?

@yaacovCR
Copy link
Owner

I think you are right, this was to support the createServerHttpLink for supporting graphql uploads. I was planning on splitting that off to a separate repo at some point.

How urgent is this for you?

Originally, I thought next major version would be with graphql v15, but was convinced to add backwards compatible support, so no major version bump was required.

@yaacovCR
Copy link
Owner

yaacovCR commented Feb 17, 2020

@darkbasic Not sure if it helps, but I removed explicit inclusion of dom in v8.6.1, can you let me know? Otherwise can you set up a reproducing repository?

@darkbasic
Copy link
Author

@yaacovCR unfortunately it doesn't help:

$ yarn why graphql-tools-fork
yarn why v1.22.0
[1/4] Why do we have the module "graphql-tools-fork"...?
[2/4] Initialising dependency graph...
[3/4] Finding dependency...
[4/4] Calculating file sizes...
=> Found "graphql-tools-fork@8.6.1"
info Has been hoisted to "graphql-tools-fork"
info This module exists because it's specified in "dependencies".
info Disk size without dependencies: "1.49MB"
info Disk size with unique dependencies: "2.32MB"
info Disk size with transitive dependencies: "4.11MB"
info Number of shared dependencies: 14
Done in 0.65s.
node_modules/apollo-link-http-common/lib/index.d.ts:4:15 - error TS2304: Cannot find name 'Response'.

4     response: Response;
                ~~~~~~~~

node_modules/apollo-link-http-common/lib/index.d.ts:9:15 - error TS2304: Cannot find name 'Response'.

9     response: Response;
                ~~~~~~~~

node_modules/apollo-link-http-common/lib/index.d.ts:38:13 - error TS2304: Cannot find name 'WindowOrWorkerGlobalScope'.

38     fetch?: WindowOrWorkerGlobalScope['fetch'];
               ~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/apollo-link-http-common/lib/index.d.ts:54:81 - error TS2304: Cannot find name 'Response'.

54 export declare const parseAndCheckHttpResponse: (operations: any) => (response: Response) => Promise<any>;
                                                                                   ~~~~~~~~

node_modules/apollo-link-http-common/lib/index.d.ts:55:54 - error TS2304: Cannot find name 'RequestInfo'.

55 export declare const checkFetcher: (fetcher: (input: RequestInfo, init?: RequestInit) => Promise<Response>) => void;
                                                        ~~~~~~~~~~~

node_modules/apollo-link-http-common/lib/index.d.ts:55:74 - error TS2304: Cannot find name 'RequestInit'.

55 export declare const checkFetcher: (fetcher: (input: RequestInfo, init?: RequestInit) => Promise<Response>) => void;
                                                                            ~~~~~~~~~~~

node_modules/apollo-link-http-common/lib/index.d.ts:55:98 - error TS2304: Cannot find name 'Response'.

55 export declare const checkFetcher: (fetcher: (input: RequestInfo, init?: RequestInit) => Promise<Response>) => void;
                                                                                                    ~~~~~~~~


Found 14 errors.

How urgent is this for you?

Not really, I can easily work it around adding dom to the libs until a proper fix lands.

@yaacovCR
Copy link
Owner

I guess I am just confused (as usual) why do you as package user need to add dom, but in package itself, all functionality and tests compile with tsc without dom specified?

@yaacovCR
Copy link
Owner

@darkbasic

I am going to close this for now as I can't reproduce. I like to keep the issues section super responsive in terms of bugs. Feel free to reopen if you can share a reproduction.

@yaacovCR yaacovCR reopened this Feb 19, 2020
@yaacovCR
Copy link
Owner

Reproduced! The requirement to include dom for the library was hidden by outdated inclusion of @types/supertest in package.json.

@yaacovCR
Copy link
Owner

My fix will be as above to outsource the link as possible.

yaacovCR added a commit that referenced this issue Feb 23, 2020
@types/supertest was also hiding need for explicit inclusion of dom within typescript libs to avoid apollo-link-http-common related errors on node, see
#41 and apollographql/apollo-link#544
@yaacovCR
Copy link
Owner

Way forward on this is via merging of jaydenseric/apollo-upload-client#179

See 2d7482f

yaacovCR added a commit that referenced this issue Feb 27, 2020
@types/supertest was also hiding need for explicit inclusion of dom within typescript libs to avoid apollo-link-http-common related errors on node, see
#41 and apollographql/apollo-link#544
yaacovCR added a commit that referenced this issue Mar 26, 2020
@types/supertest was also hiding need for explicit inclusion of dom within typescript libs to avoid apollo-link-http-common related errors on node, see
#41 and apollographql/apollo-link#544
yaacovCR added a commit that referenced this issue Mar 26, 2020
@types/supertest was also hiding need for explicit inclusion of dom within typescript libs to avoid apollo-link-http-common related errors on node, see
#41 and apollographql/apollo-link#544
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants