Skip to content

Commit

Permalink
Enable import/extensions rule (#2461)
Browse files Browse the repository at this point in the history
* import/extensions

Signed-off-by: TuvalSimha <tuval.simha@gmail.com>

* fix rule

Signed-off-by: TuvalSimha <tuval.simha@gmail.com>

* prettier

Signed-off-by: TuvalSimha <tuval.simha@gmail.com>

* changeset

Signed-off-by: TuvalSimha <tuval.simha@gmail.com>

---------

Signed-off-by: TuvalSimha <tuval.simha@gmail.com>
  • Loading branch information
TuvalSimha authored Apr 23, 2023
1 parent b59a9de commit 53dae66
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 14 deletions.
5 changes: 5 additions & 0 deletions .changeset/bright-gifts-obey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-inspector/core': patch
---

Fix complexity importing for validate
13 changes: 12 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,22 @@ module.exports = {
'yml/no-empty-mapping-value': 'off',
'no-undef': 'off',
'unicorn/prefer-node-protocol': 'off',
'import/extensions': 'off',
'no-console': 'off',
'import/no-default-export': 'off',
},
},
{
files: [
'**/__tests__/**',
'**/*.spec.ts',
'**/*.test.ts',
'e2e/**',
'**/__integration-tests__/**',
],
rules: {
'import/extensions': 'off',
},
},
{
files: ['.github/**/*'],
rules: {
Expand Down
24 changes: 12 additions & 12 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,20 @@

```ts
export type FieldDescriptionChangedChange = {
type: ChangeType.FieldDescriptionChanged;
type: ChangeType.FieldDescriptionChanged
meta: {
typeName: string;
fieldName: string;
oldDescription: string;
newDescription: string;
};
};
typeName: string
fieldName: string
oldDescription: string
newDescription: string
}
}
```
You can construct the full `Change` object from the `type` and `meta` properties.
```ts
import { ChangeType, fieldDescriptionChangedFromMeta } from '@graphql-inspector/core';
import { ChangeType, fieldDescriptionChangedFromMeta } from '@graphql-inspector/core'

console.log(
fieldDescriptionChangedFromMeta({
Expand All @@ -73,10 +73,10 @@
typeName: 'Foo',
fieldName: 'bar',
oldDescription: 'This is the old description',
newDescription: 'This is the new description',
},
}),
);
newDescription: 'This is the new description'
}
})
)
```

console.log output:
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/validate/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { readDocument } from '../ast/document.js';
import { transformDocumentWithApollo, transformSchemaWithApollo } from '../utils/apollo.js';
import { findDeprecatedUsages } from '../utils/graphql.js';
import { validateAliasCount } from './alias-count.js';
import { validateComplexity, ValidateOperationComplexityConfig } from './complexity';
import { validateComplexity, ValidateOperationComplexityConfig } from './complexity.js';
import { validateDirectiveCount } from './directive-count.js';
import { validateQueryDepth } from './query-depth.js';
import { validateTokenCount } from './token-count.js';
Expand Down

0 comments on commit 53dae66

Please sign in to comment.