Bläddra i källkod

Merge pull request #2653 from Lezek123/storagev2-relations-workaround

Giza relationships querying workaround
shamil-gadelshin 3 år sedan
förälder
incheckning
1724a497cc
2 ändrade filer med 9 tillägg och 1 borttagningar
  1. 1 1
      metadata-protobuf/src/utils.ts
  2. 8 0
      query-node/schemas/storage.graphql

+ 1 - 1
metadata-protobuf/src/utils.ts

@@ -5,7 +5,7 @@ export function isSet<T>(v: T | null | undefined): v is T {
   return v !== null && v !== undefined
 }
 
-export function isEmptyObject(object: Record<string, unknown>): boolean {
+export function isEmptyObject<T>(object: T): boolean {
   return Object.keys(object).length === 0
 }
 

+ 8 - 0
query-node/schemas/storage.graphql

@@ -144,6 +144,10 @@ type StorageBagStorageAssignment @entity {
 
   "Storage bucket that should store the bag"
   storageBucket: StorageBucket!
+
+  # Relationship filtering workaround
+  storageBagId: ID
+  storageBucketId: ID
 }
 
 type StorageBagDistributionAssignment @entity {
@@ -155,6 +159,10 @@ type StorageBagDistributionAssignment @entity {
 
   "Distribution bucket that should distribute the bag"
   distributionBucket: DistributionBucket!
+
+  # Relationship filtering workaround
+  storageBagId: ID
+  distributionBucketId: ID
 }
 
 type StorageDataObject @entity {