-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lint federation subgraphs schemas without parse errors (#2814)
* a * chore(dependencies): updated changesets for modified dependencies * pnpm i * lint * Update packages/plugin/src/schema.ts --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
e8ba435
commit ccc302d
Showing
7 changed files
with
156 additions
and
27 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
.changeset/@graphql-eslint_eslint-plugin-2814-dependencies.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@graphql-eslint/eslint-plugin": patch | ||
--- | ||
dependencies updates: | ||
- Updated dependency [`@graphql-tools/graphql-tag-pluck@^8.3.4` ↗︎](https://www.npmjs.com/package/@graphql-tools/graphql-tag-pluck/v/8.3.4) (from `8.3.4`, in `dependencies`) | ||
- Added dependency [`@apollo/subgraph@^2` ↗︎](https://www.npmjs.com/package/@apollo/subgraph/v/2.0.0) (to `peerDependencies`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@graphql-eslint/eslint-plugin': minor | ||
--- | ||
|
||
lint federation subgraphs schemas without parse errors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { GRAPHQL_JS_VALIDATIONS } from '../src/rules/graphql-js-validation.js'; | ||
import { ruleTester, withSchema } from './test-utils.js'; | ||
|
||
ruleTester.run('federation', GRAPHQL_JS_VALIDATIONS['known-directives'], { | ||
valid: [ | ||
withSchema({ | ||
name: 'should parse federation directive without errors', | ||
code: /* GraphQL */ ` | ||
scalar DateTime | ||
type Post @key(fields: "id") { | ||
id: ID! | ||
title: String | ||
createdAt: DateTime | ||
modifiedAt: DateTime | ||
} | ||
type Query { | ||
post: Post! | ||
posts: [Post!] | ||
} | ||
extend schema @link(url: "https://specs.apollo.dev/federation/v2.3", import: ["@key"]) | ||
`, | ||
}), | ||
], | ||
invalid: [], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.