@faststore/core 3.38.0 → 3.38.2

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.
Files changed (37) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +14 -14
  3. package/.next/cache/.tsbuildinfo +1 -1
  4. package/.next/cache/config.json +3 -3
  5. package/.next/cache/webpack/client-production/0.pack +0 -0
  6. package/.next/cache/webpack/client-production/index.pack +0 -0
  7. package/.next/cache/webpack/server-production/0.pack +0 -0
  8. package/.next/cache/webpack/server-production/index.pack +0 -0
  9. package/.next/prerender-manifest.js +1 -1
  10. package/.next/prerender-manifest.json +1 -1
  11. package/.next/react-loadable-manifest.json +1 -1
  12. package/.next/routes-manifest.json +1 -1
  13. package/.next/server/chunks/8112.js +2 -2
  14. package/.next/server/middleware-build-manifest.js +1 -1
  15. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  16. package/.next/server/pages/[...slug].js.nft.json +1 -1
  17. package/.next/server/pages/[slug]/p.js.nft.json +1 -1
  18. package/.next/server/pages/api/graphql.js +1 -1
  19. package/.next/server/pages/api/graphql.js.nft.json +1 -1
  20. package/.next/server/pages/en-US/404.html +2 -2
  21. package/.next/server/pages/en-US/500.html +2 -2
  22. package/.next/server/pages/en-US/checkout.html +2 -2
  23. package/.next/server/pages/en-US/login.html +2 -2
  24. package/.next/server/pages/en-US/s.html +2 -2
  25. package/.next/server/pages/en-US.html +2 -2
  26. package/.next/server/pages-manifest.json +1 -1
  27. package/.next/static/chunks/{1552.b5a073e7ac834965.js → 1552.e7cece605fc2e1cd.js} +1 -1
  28. package/.next/static/chunks/{webpack-827d211260f776ab.js → webpack-1cd1c4aa7f418483.js} +1 -1
  29. package/.next/trace +108 -124
  30. package/.turbo/turbo-build.log +8 -8
  31. package/.turbo/turbo-test.log +5 -5
  32. package/CHANGELOG.md +10 -0
  33. package/package.json +3 -3
  34. package/src/pages/api/graphql.ts +10 -1
  35. package/src/server/index.ts +3 -2
  36. /package/.next/static/{TtHka3ak_ylWr80LGRO5P → n9bmNbvmxPNu4CeTsa684}/_buildManifest.js +0 -0
  37. /package/.next/static/{TtHka3ak_ylWr80LGRO5P → n9bmNbvmxPNu4CeTsa684}/_ssgManifest.js +0 -0
@@ -1,23 +1,23 @@
1
1
 
2
- > @faststore/core@3.37.0 prebuild /home/runner/work/faststore/faststore/packages/core
2
+ > @faststore/core@3.38.1 prebuild /home/runner/work/faststore/faststore/packages/core
3
3
  > na run partytown && na run generate
4
4
 
5
5
 
6
- > @faststore/core@3.37.0 partytown /home/runner/work/faststore/faststore/packages/core
6
+ > @faststore/core@3.38.1 partytown /home/runner/work/faststore/faststore/packages/core
7
7
  > partytown copylib ./public/~partytown
8
8
 
9
9
  Partytown lib copied to: /home/runner/work/faststore/faststore/packages/core/public/~partytown
10
10
 
11
- > @faststore/core@3.37.0 generate /home/runner/work/faststore/faststore/packages/core
11
+ > @faststore/core@3.38.1 generate /home/runner/work/faststore/faststore/packages/core
12
12
  > na run generate:schema && na run generate:codegen && na run format:generated
13
13
 
14
14
 
15
- > @faststore/core@3.37.0 generate:schema /home/runner/work/faststore/faststore/packages/core
15
+ > @faststore/core@3.38.1 generate:schema /home/runner/work/faststore/faststore/packages/core
16
16
  > tsx src/server/generator/generateGraphQLSchemaFile.ts
17
17
 
18
18
  Schema GraphQL file generated successfully
19
19
 
20
- > @faststore/core@3.37.0 generate:codegen /home/runner/work/faststore/faststore/packages/core
20
+ > @faststore/core@3.38.1 generate:codegen /home/runner/work/faststore/faststore/packages/core
21
21
  > graphql-codegen
22
22
 
23
23
  [STARTED] Parse Configuration
@@ -37,11 +37,11 @@ Running lifecycle hook "afterStart" scripts...
37
37
  [CLI] Loading Documents
38
38
  [CLI] Generating output
39
39
 
40
- > @faststore/core@3.37.0 format:generated /home/runner/work/faststore/faststore/packages/core
40
+ > @faststore/core@3.38.1 format:generated /home/runner/work/faststore/faststore/packages/core
41
41
  > prettier --write "@generated/**/*.{ts,js,tsx,jsx,json}" --loglevel error
42
42
 
43
43
 
44
- > @faststore/core@3.37.0 build /home/runner/work/faststore/faststore/packages/core
44
+ > @faststore/core@3.38.1 build /home/runner/work/faststore/faststore/packages/core
45
45
  > next build
46
46
 
47
47
  ⚠ No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
@@ -91,7 +91,7 @@ Route (pages) Size First Load JS
91
91
  ├ chunks/framework-807b0f81cbc129f0.js 45.4 kB
92
92
  ├ chunks/main-5569625b3fdd6741.js 33.1 kB
93
93
  ├ chunks/pages/_app-012e51403727ae6a.js 10.4 kB
94
- ├ chunks/webpack-827d211260f776ab.js 3.59 kB
94
+ ├ chunks/webpack-1cd1c4aa7f418483.js 3.59 kB
95
95
  └ css/0a57ee6c7a57788c.css 3.49 kB
96
96
 
97
97
  λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
@@ -1,14 +1,14 @@
1
1
 
2
- > @faststore/core@3.37.0 test /home/runner/work/faststore/faststore/packages/core
2
+ > @faststore/core@3.38.1 test /home/runner/work/faststore/faststore/packages/core
3
3
  > jest
4
4
 
5
- PASS test/utils/multipleTemplates.test.ts (24.636 s)
6
- PASS test/server/cms/global.test.ts (24.95 s)
5
+ PASS test/server/cms/global.test.ts (22.299 s)
6
+ PASS test/utils/multipleTemplates.test.ts (23.961 s)
7
7
  PASS test/server/cms/index.test.ts
8
- PASS test/server/index.test.ts (31.034 s)
8
+ PASS test/server/index.test.ts (27.551 s)
9
9
 
10
10
  Test Suites: 4 passed, 4 total
11
11
  Tests: 22 passed, 22 total
12
12
  Snapshots: 0 total
13
- Time: 32.155 s
13
+ Time: 28.857 s
14
14
  Ran all test suites.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,16 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [3.38.2](https://github.com/vtex/faststore/compare/v3.38.1...v3.38.2) (2025-04-10)
7
+
8
+ ### Bug Fixes
9
+
10
+ - returns 4XX error when query not exist ([#2779](https://github.com/vtex/faststore/issues/2779)) ([013454e](https://github.com/vtex/faststore/commit/013454e6b5bcd1f0e6ddb4d5ff49affd664a9209))
11
+
12
+ ## [3.38.1](https://github.com/vtex/faststore/compare/v3.38.0...v3.38.1) (2025-04-10)
13
+
14
+ **Note:** Version bump only for package @faststore/core
15
+
6
16
  # [3.38.0](https://github.com/vtex/faststore/compare/v3.37.0...v3.38.0) (2025-04-10)
7
17
 
8
18
  ### Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faststore/core",
3
- "version": "3.38.0",
3
+ "version": "3.38.2",
4
4
  "license": "MIT",
5
5
  "repository": "vtex/faststore",
6
6
  "browserslist": "supports es6-module and not dead",
@@ -44,7 +44,7 @@
44
44
  "@envelop/graphql-jit": "^8.0.3",
45
45
  "@envelop/parser-cache": "^6.0.2",
46
46
  "@envelop/validation-cache": "^6.0.2",
47
- "@faststore/api": "^3.35.0",
47
+ "@faststore/api": "^3.38.1",
48
48
  "@faststore/components": "^3.28.0",
49
49
  "@faststore/graphql-utils": "^3.28.0",
50
50
  "@faststore/lighthouse": "^3.28.0",
@@ -105,5 +105,5 @@
105
105
  "ts-jest": "29.1.1",
106
106
  "typescript": "5.3.2"
107
107
  },
108
- "gitHead": "2cd5ffe92ca463956d8ee2dea75cd29c16c13027"
108
+ "gitHead": "88ba78825760f34ddb4477176b1c560ca2efcbf4"
109
109
  }
@@ -1,4 +1,8 @@
1
- import { isFastStoreError, stringifyCacheControl } from '@faststore/api'
1
+ import {
2
+ BadRequestError,
3
+ isFastStoreError,
4
+ stringifyCacheControl,
5
+ } from '@faststore/api'
2
6
  import type { NextApiHandler, NextApiRequest } from 'next'
3
7
 
4
8
  import { execute } from '../../server'
@@ -121,6 +125,11 @@ const handler: NextApiHandler = async (request, response) => {
121
125
  } catch (err) {
122
126
  console.error(err)
123
127
 
128
+ if (err instanceof BadRequestError) {
129
+ response.status(400).end()
130
+ return
131
+ }
132
+
124
133
  response.status(500).end()
125
134
  }
126
135
  }
@@ -11,6 +11,7 @@ import { useParserCache } from '@envelop/parser-cache'
11
11
  import { useValidationCache } from '@envelop/validation-cache'
12
12
  import type { CacheControl, Maybe } from '@faststore/api'
13
13
  import {
14
+ BadRequestError,
14
15
  getContextFactory,
15
16
  getResolvers,
16
17
  isFastStoreError,
@@ -98,8 +99,8 @@ export const execute = async <V extends Maybe<{ [key: string]: unknown }>, D>(
98
99
  const query = maybeQuery ?? persistedQueries.get(operationHash)
99
100
 
100
101
  if (query == null) {
101
- throw new Error(
102
- `No query found for operationName ${operationName} and operationHash ${operationHash}`
102
+ throw new BadRequestError(
103
+ `No query found for operationName ${operationName} and operationHash ${operationHash}.`
103
104
  )
104
105
  }
105
106