question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot disable relay-page-info-spec

See original GitHub issue

Please consider the schema below. The comment at the top follows the docs for disabling a rule. When running the linter against that schema, the error A ``PageInfo`` object type is required as per the Relay spec. is thrown even though the linter is being instructed to ignore it.

# lint-disable relay-page-info-spec

##
# GraphQL Service
#   Name: batman-service
#   Intent: This service summons batman to fight villans
#
##

""" A hero character. These are the good guys """
type Hero {
  enemies: [Villain]
  friends: [Hero]
  id: ID!
  name: String!
}

""" A villain character. These are the bad guys """
type Villain {
  enemies: [Hero]
  friends: [Villain]
  id: ID!
  name: String!
}

""" Query Root """
type Query {
  """ Summons batman """
  summon: Hero
}

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
uasicommented, Aug 30, 2022

I believe the problem is because lint-disable does not affect the line it is written on, so the error at 1:1 is not silenced by it.

https://github.com/cjoudrey/graphql-schema-linter/blob/fb0dd421138a5385de9be783393fd5f684219400/src/validator.js#L141

0reactions
FlyingDouchemancommented, Nov 28, 2022

Small bump on the above issue since the given workaround will not work much longer: ‼ The --only and --except command line options have been deprecated. They will be removed in v1.0.0.

Read more comments on GitHub >

github_iconTop Results From Across the Web

GraphQL Cursor Connections Specification - Relay
This specification aims to provide an option for GraphQL clients to consistently handle ... Connection types must have fields named edges and pageInfo...
Read more >
Relay Cursor Connections Specification
An object named PageInfo . 2Connection Types. Any type whose name ends in “Connection” is considered by Relay to be a Connection Type....
Read more >
Understanding pagination: REST, GraphQL, and Relay
pageInfo lets the client know if there are more pages of data to fetch. In the Relay specification, it doesn't tell you the...
Read more >
Relay Connection - Plugins - GraphQL Nexus
The connection plugin provides a new method on the object definition builder, enabling paginated associations between types, following the Relay Connection ...
Read more >
How to Handle List inside Connection in Graphql Relay
From the Relay spec: ... Notably, this field cannot return a list. ... your schema must be compliant with the Relay specification.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found