@faststore/api 1.6.7 → 1.6.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -142,6 +142,7 @@ export const Query = {
142
142
  endCursor: (
143
143
  Math.min(first, validCollections.length - after) - 1
144
144
  ).toString(),
145
+ totalCount: validCollections.length,
145
146
  },
146
147
  edges: validCollections
147
148
  .slice(after, after + first)
@@ -151,4 +152,20 @@ export const Query = {
151
152
  })),
152
153
  }
153
154
  },
155
+ person: async (_: unknown, __: unknown, ctx: Context) => {
156
+ const {
157
+ clients: { commerce },
158
+ } = ctx
159
+
160
+ const {
161
+ namespaces: { profile },
162
+ } = await commerce.session()
163
+
164
+ return {
165
+ id: profile?.id?.value ?? '',
166
+ email: profile?.email?.value ?? '',
167
+ givenName: profile?.firstName?.value ?? '',
168
+ familyName: profile?.lastName?.value ?? '',
169
+ }
170
+ },
154
171
  }
@@ -44,6 +44,13 @@ type StoreSearchResult {
44
44
  facets: [StoreFacet!]!
45
45
  }
46
46
 
47
+ type StorePerson {
48
+ id: String!
49
+ email: String!
50
+ givenName: String!
51
+ familyName: String!
52
+ }
53
+
47
54
  type Query {
48
55
  product(locator: [IStoreSelectedFacet!]!): StoreProduct!
49
56
 
@@ -60,4 +67,6 @@ type Query {
60
67
  allProducts(first: Int!, after: String): StoreProductConnection!
61
68
 
62
69
  allCollections(first: Int!, after: String): StoreCollectionConnection!
70
+
71
+ person: StorePerson!
63
72
  }