Skip to content

Commit 0563d49

Browse files
committed
fix(fieldname): rename supported_schemas to eas_schema
Updates the where clause and field name to use eas_schema which is more intuitive
1 parent cfe52a7 commit 0563d49

File tree

7 files changed

+13
-10
lines changed

7 files changed

+13
-10
lines changed

schema.graphql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ type Attestation {
8181
"""Encoded data of the attestation"""
8282
data: JSON
8383

84+
"""Schema related to the attestation"""
85+
eas_schema: AttestationSchemaBaseType!
86+
8487
"""Hypercert related to the attestation"""
8588
hypercert: HypercertBaseType!
8689
id: ID!
@@ -100,9 +103,6 @@ type Attestation {
100103
"""Unique identifier of the EAS schema used to create the attestation"""
101104
schema_uid: String
102105

103-
"""Schema related to the attestation"""
104-
supported_schemas: AttestationSchemaBaseType!
105-
106106
"""Unique identifier for the attestation on EAS"""
107107
uid: ID
108108
}
@@ -203,13 +203,13 @@ input AttestationWhereInput {
203203
contract_address: StringSearchOptions
204204
creation_block_number: BigIntSearchOptions
205205
creation_block_timestamp: BigIntSearchOptions
206+
eas_schema: BasicAttestationSchemaWhereInput
206207
hypercerts: BasicHypercertWhereArgs
207208
last_update_block_number: BigIntSearchOptions
208209
last_update_block_timestamp: BigIntSearchOptions
209210
metadata: BasicMetadataWhereInput
210211
recipient: StringSearchOptions
211212
resolver: StringSearchOptions
212-
supported_schemas: BasicAttestationSchemaWhereInput
213213
token_id: StringSearchOptions
214214
uid: StringSearchOptions
215215
}

src/graphql/schemas/args/attestationArgs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class AttestationWhereInput extends BasicAttestationWhereInput {
1515
@Field(() => BasicMetadataWhereInput, { nullable: true })
1616
metadata?: BasicMetadataWhereInput;
1717
@Field(() => BasicAttestationSchemaWhereInput, { nullable: true })
18-
supported_schemas?: BasicAttestationSchemaWhereInput;
18+
eas_schema?: BasicAttestationSchemaWhereInput;
1919
}
2020

2121
@InputType()

src/graphql/schemas/resolvers/attestationResolver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class AttestationResolver extends AttestationBaseResolver {
5656
}
5757

5858
@FieldResolver()
59-
async supported_schemas(@Root() attestation: Attestation) {
59+
async eas_schema(@Root() attestation: Attestation) {
6060
if (!attestation.schema_uid) return;
6161

6262
return await this.getAttestationSchemas(

src/graphql/schemas/resolvers/baseTypes.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,6 @@ export function createBaseResolver<T extends ClassType>(
258258
try {
259259
const queries = this.supabaseCachingService.getAttestations(args);
260260

261-
console.log("GOT QUERY", queries);
262261
if (single) {
263262
const res = await queries.data.executeTakeFirst();
264263
return res ? this.parseAttestation(res) : null;

src/graphql/schemas/typeDefs/attestationTypeDefs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Attestation extends AttestationBaseType {
1616
@Field(() => AttestationSchemaBaseType, {
1717
description: "Schema related to the attestation",
1818
})
19-
supported_schemas?: AttestationSchemaBaseType;
19+
eas_schema?: AttestationSchemaBaseType;
2020
}
2121

2222
export { Attestation };

src/graphql/schemas/utils/filters-kysely.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ export const generateFilterValues = (
5757

5858
export const getTablePrefix = (column: string): string => {
5959
switch (column) {
60+
case "eas_schema":
61+
return "supported_schemas";
6062
case "hypercerts":
6163
return "claims";
6264
case "contract":

src/services/SupabaseCachingService.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,14 @@ export class SupabaseCachingService extends BaseSupabaseService<CachingDatabase>
100100
.$if(args.where?.metadata, (qb) =>
101101
qb.innerJoin("metadata", "metadata.uri", "claims.uri"),
102102
)
103-
.$if(args.where?.supported_schemas, (qb) =>
103+
.$if(args.where?.eas_schema, (qb) =>
104104
qb.innerJoin(
105105
"supported_schemas",
106106
"supported_schemas.id",
107107
"attestations.supported_schemas_id",
108108
),
109109
);
110+
case "eas_schema":
110111
case "supported_schemas":
111112
case "attestation_schema":
112113
return this.db.selectFrom("supported_schemas").selectAll();
@@ -172,7 +173,7 @@ export class SupabaseCachingService extends BaseSupabaseService<CachingDatabase>
172173
.$if(args.where?.metadata, (qb) =>
173174
qb.innerJoin("metadata", "metadata.uri", "claims.uri"),
174175
)
175-
.$if(args.where?.supported_schemas, (qb) =>
176+
.$if(args.where?.eas_schema, (qb) =>
176177
qb.innerJoin(
177178
"supported_schemas",
178179
"supported_schemas.id",
@@ -182,6 +183,7 @@ export class SupabaseCachingService extends BaseSupabaseService<CachingDatabase>
182183
.select((expressionBuilder) => {
183184
return expressionBuilder.fn.countAll().as("count");
184185
});
186+
case "eas_schema":
185187
case "supported_schemas":
186188
case "attestation_schema":
187189
return this.db

0 commit comments

Comments
 (0)