MinaProtocol / mina

Mina is a cryptocurrency protocol with a constant size blockchain, improving scaling while maintaining decentralization and security.
https://minaprotocol.com
Apache License 2.0
1.99k stars 529 forks source link

protocolStateProof breaks the Graphql schema #7909

Closed nerdvibe closed 3 years ago

nerdvibe commented 3 years ago

Working with the Mina Node GraphQL API, I found out a todo in the code that is generating an invalid GraphQL schema.

The type protocolStateProof breaks the GraphQL schema validation because is an empty type, which is not a valid definition. Some clients might ignore the issue but stricter clients will fail.

Code definition: https://github.com/MinaProtocol/mina/blob/22c1608ba40b135e256a0b368ba7e4a8f320b5ae/src/lib/mina_graphql/mina_graphql.ml#L1378

From the GraphQL specs

An Object type must define one or more fields.

Suggestion:

If you don't want to consider deleting it or commenting it, then assign a dummy definition to it like the following:

type protocolStateProof {
  _ : Boolean
}

(carbonara from Discord)

garethtdavies commented 3 years ago

See #7906 and #6137

mrmr1993 commented 3 years ago

This was fixed in #7941. Closing.