require-import-fragment
💡 This rule provides suggestions
- Category:
Operations
- Rule name:
@graphql-eslint/require-import-fragment
- Requires GraphQL Schema:
false
ℹ️ - Requires GraphQL Operations:
true
ℹ️
Usage Examples
Incorrect
# eslint @graphql-eslint/require-import-fragment: 'error'
query {
user {
...UserFields
}
}
Incorrect
# eslint @graphql-eslint/require-import-fragment: 'error'
# import 'post-fields.fragment.graphql'
query {
user {
...UserFields
}
}
Incorrect
# eslint @graphql-eslint/require-import-fragment: 'error'
# import UserFields from 'post-fields.fragment.graphql'
query {
user {
...UserFields
}
}
Correct
# eslint @graphql-eslint/require-import-fragment: 'error'
# import UserFields from 'user-fields.fragment.graphql'
query {
user {
...UserFields
}
}
Resources
Last updated on