@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.
- package/CHANGELOG.md +27 -0
- package/dist/__generated__/schema.d.ts +8 -0
- package/dist/api.cjs.development.js +34 -5
- package/dist/api.cjs.development.js.map +1 -1
- package/dist/api.cjs.production.min.js +1 -1
- package/dist/api.cjs.production.min.js.map +1 -1
- package/dist/api.esm.js +34 -5
- package/dist/api.esm.js.map +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/platforms/vtex/clients/commerce/index.d.ts +2 -0
- package/dist/platforms/vtex/clients/commerce/types/Session.d.ts +16 -0
- package/dist/platforms/vtex/clients/index.d.ts +1 -0
- package/dist/platforms/vtex/index.d.ts +8 -0
- package/dist/platforms/vtex/resolvers/query.d.ts +7 -0
- package/package.json +2 -2
- package/src/__generated__/schema.ts +9 -0
- package/src/platforms/vtex/clients/commerce/index.ts +14 -1
- package/src/platforms/vtex/clients/commerce/types/Session.ts +19 -0
- package/src/platforms/vtex/index.ts +1 -0
- package/src/platforms/vtex/resolvers/query.ts +17 -0
- package/src/typeDefs/query.graphql +9 -0
|
@@ -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
|
}
|