Skip to content

Instantly share code, notes, and snippets.

@dirtycajunrice
Last active April 22, 2025 07:48
Show Gist options
  • Save dirtycajunrice/02506665ae020f9b05150b45b3f4d02a to your computer and use it in GitHub Desktop.
Save dirtycajunrice/02506665ae020f9b05150b45b3f4d02a to your computer and use it in GitHub Desktop.
Subsquid GraphQL type hinting
schema:
- squid-schema.graphql
- schema.graphql
# ————————————————
# Directive definitions (for subsquid schema.graphql type hinting)
# ————————————————
directive @entity(
queryName: String,
listQueryName: String
) on OBJECT
directive @query on INTERFACE
directive @derivedFrom(
field: String!
) on FIELD_DEFINITION
directive @unique on FIELD_DEFINITION
directive @index(
fields: [String!]
unique: Boolean
) repeatable on OBJECT | FIELD_DEFINITION
directive @fulltext(
query: String!
) on FIELD_DEFINITION
directive @cardinality(
value: Int!
) on OBJECT | FIELD_DEFINITION
directive @byteWeight(
value: Float!
) on FIELD_DEFINITION
# ————————————————
# Scalar stubs
# ————————————————
scalar DateTime
# — include whatever you have in `customScalars` —
# for example, if you export BigInt, BigDecimal, Bytes:
scalar BigDecimal
scalar Bytes
scalar BigInt
scalar JSON
# If you also use JSON-like scalars:
scalar JSONObject
scalar JSONValue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment