mobxjs / mst-gql

Bindings for mobx-state-tree and GraphQL
MIT License
684 stars 81 forks source link

Doesn't work with PNP node modules #353

Open factoidforrest opened 2 years ago

factoidforrest commented 2 years ago

This is a brittle way to go about invoking the apollo schema downloader CLI.

 const command = `${__dirname}/../../.bin/apollo client:download-schema --endpoint=${input} ${tmpFile} ${

This doesn't work with PNP and I think it will also break in some monorepos, where, for instance, your library could be at two lower level node-module folders but apollo is at the top level deduped.

Since the apollo CLI is javascript, I would either find a way to invoke the functionality you need directly with a javascript import, or use a different library to do the job. You could probably also get away without writing to a temp file which would be cleaner.

To make the current lib work with PNP, I had to unplug both apollo and mst-gql, and then do a manual symlink between their folders to get the binary where your lib expects it to be.

jesse-savary commented 2 years ago

There's a good chance this works already w/ 0.17.0 but I will do some manual testing.