Skip to content

Commit

Permalink
fix: make graphql types match typescript
Browse files Browse the repository at this point in the history
Typescript says this id is optional, but the GraphQL type inferred from
the decorator said it wasn't. This fixes the mismatch.

As a side effect, this also updated the ids in schema.graphql.
  • Loading branch information
pheuberger committed Jan 20, 2025
1 parent 03b2432 commit 05b1e8d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
24 changes: 12 additions & 12 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type AllowlistRecord {

"""The hypercert ID the claimable fraction belongs to"""
hypercert_id: String
id: ID!
id: ID

"""The leaf of the Merkle tree for the claimable fraction"""
leaf: String
Expand Down Expand Up @@ -83,7 +83,7 @@ type Attestation {

"""Hypercert related to the attestation"""
hypercert: HypercertBaseType
id: ID!
id: ID

"""Block number at which the attestation was last updated"""
last_update_block_number: EthBigInt
Expand Down Expand Up @@ -115,7 +115,7 @@ input AttestationFetchInput {
type AttestationSchema {
"""Chain ID of the chains where the attestation schema is supported"""
chain_id: EthBigInt
id: ID!
id: ID

"""List of attestations related to the attestation schema"""
records: [Attestation!]
Expand Down Expand Up @@ -286,7 +286,7 @@ type Collection {

"""Description of the collection"""
description: String!
id: ID!
id: ID

"""Name of the collection"""
name: String!
Expand All @@ -299,7 +299,7 @@ type Contract {

"""The address of the contract"""
contract_address: String
id: ID!
id: ID

"""The block number at which the contract was deployed"""
start_block: EthBigInt
Expand Down Expand Up @@ -341,7 +341,7 @@ type Fraction {
The ID of the fraction concatenated from the chain ID, contract address, and ID of the hypercert claim
"""
hypercert_id: ID
id: ID!
id: ID

"""Block number of the last update of the fraction"""
last_update_block_number: EthBigInt
Expand Down Expand Up @@ -482,7 +482,7 @@ type Hyperboard {

"""Whether the hyperboard should be rendered as a grayscale image"""
grayscale_images: Boolean
id: ID!
id: ID

"""Name of the hyperboard"""
name: String!
Expand Down Expand Up @@ -555,7 +555,7 @@ type Hypercert {
Concatenation of [chainID]-[contractAddress]-[tokenID] to discern hypercerts across chains
"""
hypercert_id: ID
id: ID!
id: ID
last_update_block_number: EthBigInt
last_update_block_timestamp: EthBigInt

Expand Down Expand Up @@ -597,7 +597,7 @@ type HypercertBaseType {
Concatenation of [chainID]-[contractAddress]-[tokenID] to discern hypercerts across chains
"""
hypercert_id: ID
id: ID!
id: ID
last_update_block_number: EthBigInt
last_update_block_timestamp: EthBigInt

Expand Down Expand Up @@ -682,7 +682,7 @@ type Metadata {

"""References additional information related to the hypercert"""
external_url: String
id: ID!
id: ID

"""Base64 encoded representation of the image of the hypercert"""
image: String
Expand Down Expand Up @@ -780,7 +780,7 @@ type Order {
"""The hypercert associated with this order"""
hypercert: HypercertBaseType
hypercert_id: String!
id: ID!
id: ID
invalidated: Boolean!
itemIds: [String!]!
orderNonce: String!
Expand Down Expand Up @@ -868,7 +868,7 @@ type Sale {

"""The ID of the hypercert token referenced in the order"""
hypercert_id: String
id: ID!
id: ID

"""Token ids of the sold fractions"""
item_ids: [EthBigInt!]
Expand Down
2 changes: 1 addition & 1 deletion src/graphql/schemas/typeDefs/baseTypes/basicTypeDef.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Field, ID, ObjectType } from "type-graphql";

@ObjectType()
class BasicTypeDef {
@Field(() => ID)
@Field(() => ID, { nullable: true })
id?: string;
}

Expand Down

0 comments on commit 05b1e8d

Please sign in to comment.