Kaynağa Gözat

feat(server): Implement Node interface for all GraphQL entity types

Michael Bromley 7 yıl önce
ebeveyn
işleme
23abf8fca9

+ 8 - 0
server/src/common/common-types.graphql

@@ -0,0 +1,8 @@
+interface PaginatedList {
+    items: [Node!]!
+    totalItems: Int!
+}
+
+interface Node {
+    id: Int!
+}

+ 2 - 2
server/src/entity/address/address.graphql

@@ -1,5 +1,5 @@
-type Address {
-  id: Int
+type Address implements Node {
+  id: Int!
   fullName: String
   company: String
   streetLine1: String

+ 2 - 2
server/src/entity/administrator/administrator.graphql

@@ -1,5 +1,5 @@
-type Administrator {
-    id: Int
+type Administrator implements Node {
+    id: Int!
     firstName: String
     lastName: String
     emailAddress: String

+ 2 - 2
server/src/entity/customer/customer.graphql

@@ -1,5 +1,5 @@
-type Customer {
-  id: Int
+type Customer implements Node {
+  id: Int!
   firstName: String
   lastName: String
   phoneNumber: String

+ 2 - 2
server/src/entity/product-option-group/product-option-group.graphql

@@ -1,5 +1,5 @@
-type ProductOptionGroup {
-    id: Int
+type ProductOptionGroup implements Node {
+    id: Int!
     languageCode: LanguageCode
     code: String
     name: String

+ 2 - 2
server/src/entity/product-option/product-option.graphql

@@ -1,5 +1,5 @@
-type ProductOption {
-    id: Int
+type ProductOption implements Node {
+    id: Int!
     languageCode: LanguageCode
     code: String
     name: String

+ 2 - 2
server/src/entity/product-variant/product-variant.graphql

@@ -1,5 +1,5 @@
-type ProductVariant {
-    id: Int
+type ProductVariant implements Node {
+    id: Int!
     sku: String
     name: String
     image: String

+ 1 - 1
server/src/entity/product/product.graphql

@@ -1,4 +1,4 @@
-type Product {
+type Product implements Node {
     id: Int!
     languageCode: LanguageCode
     name: String

+ 2 - 2
server/src/entity/user/user.graphql

@@ -1,5 +1,5 @@
-type User {
-    id: Int
+type User implements Node {
+    id: Int!
     identifier: String
     passwordHash: String
     roles: [String]