Mirror: TypeScript LSP plugin that finds GraphQL documents in your code and provides diagnostics, auto-complete and hover-information.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

stop checking for co-located fragments by default (#99)

authored by

Jovi De Croock and committed by
GitHub
277ca619 7a3817b6

+18 -9
+5
.changeset/brave-tigers-talk.md
··· 1 + --- 2 + '@0no-co/graphqlsp': minor 3 + --- 4 + 5 + Change default config to not check for co-located fragments by default
+7 -2
packages/graphqlsp/README.md
··· 43 43 44 44 ### Configuration 45 45 46 + **Required** 47 + 46 48 - `schema` allows you to specify a url, `.json` or `.graphql` file as your schema. If you need to specify headers for your introspection 47 49 you can opt into the object notation i.e. `{ "schema": { "url": "x", "headers": { "Authorization": "y" } }}` 48 - - `disableTypegen` disables type-generation in general 50 + 51 + **Optional** 52 + 53 + - `disableTypegen` disables type-generation in general, this could be needed if offset bugs are introduced 49 54 - `scalars` allows you to pass an object of scalars that we'll feed into `graphql-code-generator` 50 55 - `extraTypes` allows you to specify imports or declare types to help with `scalar` definitions 51 - - `shouldCheckForColocatedFragments` when turned on (default), this will scan your imports to find 56 + - `shouldCheckForColocatedFragments` when turned on, this will scan your imports to find 52 57 unused fragments and provide a message notifying you about them 53 58 54 59 ## Fragment masking
+1 -1
packages/graphqlsp/src/diagnostics.ts
··· 48 48 const tagTemplate = info.config.template || 'gql'; 49 49 const scalars = info.config.scalars || {}; 50 50 const shouldCheckForColocatedFragments = 51 - info.config.shouldCheckForColocatedFragments ?? true; 51 + info.config.shouldCheckForColocatedFragments ?? false; 52 52 53 53 let source = getSource(info, filename); 54 54 if (!source) return undefined;
+3 -5
pnpm-lock.yaml
··· 362 362 /@babel/plugin-proposal-class-properties@7.18.6(@babel/core@7.20.5): 363 363 resolution: {integrity: sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ==} 364 364 engines: {node: '>=6.9.0'} 365 + deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead. 365 366 peerDependencies: 366 367 '@babel/core': ^7.0.0-0 367 368 dependencies: ··· 374 375 /@babel/plugin-proposal-object-rest-spread@7.20.2(@babel/core@7.20.5): 375 376 resolution: {integrity: sha512-Ks6uej9WFK+fvIMesSqbAto5dD8Dz4VuuFvGJFKgIGSkJuRGcrwGECPA1fDgQK3/DbExBJpEkTeYeB8geIFCSQ==} 376 377 engines: {node: '>=6.9.0'} 378 + deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-object-rest-spread instead. 377 379 peerDependencies: 378 380 '@babel/core': ^7.0.0-0 379 381 dependencies: ··· 3509 3511 /rxjs@7.8.0: 3510 3512 resolution: {integrity: sha512-F2+gxDshqmIub1KdvZkaEfGDwLNpPvk9Fs6LD/MyQxNgMds/WH9OdDDXOmxUZpME+iSK3rQCctkL0DYyytUqMg==} 3511 3513 dependencies: 3512 - tslib: 2.4.1 3514 + tslib: 2.5.0 3513 3515 dev: true 3514 3516 3515 3517 /safe-buffer@5.2.1: ··· 3903 3905 /trim-newlines@3.0.1: 3904 3906 resolution: {integrity: sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==} 3905 3907 engines: {node: '>=8'} 3906 - dev: true 3907 - 3908 - /tslib@2.4.1: 3909 - resolution: {integrity: sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==} 3910 3908 dev: true 3911 3909 3912 3910 /tslib@2.5.0:
+2 -1
test/e2e/fixture-project/tsconfig.json
··· 3 3 "plugins": [ 4 4 { 5 5 "name": "@0no-co/graphqlsp", 6 - "schema": "./schema.graphql" 6 + "schema": "./schema.graphql", 7 + "shouldCheckForColocatedFragments": true 7 8 } 8 9 ], 9 10 "target": "es2016",