Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
*.graphql
module declaration conflicts with similar declarations in many projects. And in my opinion it's out of the scope of this library. I will try to explain my reasoning:Unfortunately TypeScript doesn't have an option to exclude types from NPM packages. So these these types are loaded without a way to opt-out.
But many projects might have different needs for *.graphql typings. e.g:
Add specific modules for every
*.graphql
fileThe populare tool "Graphql Code Generator" can autogenerate imports for graphql-files, example here: https://graphql-code-generator.com/docs/plugins/typescript-graphql-files-modules#example
Allow named imports from
*.graphql
-files (e.g Queries & Mutations) usinggraphql-tag/loader
:e.g
import { SomeQuery, AnotherQuery } from 'somefile.graphql'
.One way to allow this is by a simple any declaration:
declare module '*.graphql';
Not every typescript project has some loader configured to load
*.graphql
-files.So having these types by default makes incorrect assumptions.
These kind of custom declarations are not possible when using vue-apollo 3.x due to this fixed type which is bundled with vue-apollo.
I propose to just remove the type file again and add docs which explain the situation.
Failing example
Error:
Workaround
Downgrade and pin
3.0.0-rc.7
. Packge json: