-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump nuxt from 3.0.0-rc.6 to 3.0.0-rc.8 (#1304)
Bumps [nuxt](https://github.com/nuxt/nuxt.js) from 3.0.0-rc.6 to 3.0.0-rc.8. - [Release notes](https://github.com/nuxt/nuxt.js/releases) - [Changelog](https://github.com/nuxt/nuxt.js/blob/dev/RELEASE_PLAN.md) - [Commits](https://github.com/nuxt/nuxt.js/commits) --- updated-dependencies: - dependency-name: nuxt dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- Loading branch information
1 parent
1e5ffcb
commit 2733348
Showing
5 changed files
with
786 additions
and
498 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { defineNuxtModule } from '@nuxt/kit' | ||
import { printSchema } from 'graphql' | ||
import { loadSchema as loadGraphqlSchema } from '@graphql-tools/load' | ||
import { GraphQLFileLoader } from '@graphql-tools/graphql-file-loader' | ||
|
||
// WARNING: This is a duplicate of the function with the same name defined in server/schema | ||
// Due to how nuxt/kit works, we have to define the module as a mjs file instead of ts (otherwise it resolves imports as cjs) | ||
// And thus we cannot reuse a ts file here | ||
/** | ||
* Loads the schema from the GraphQL files. | ||
* This method should not be used in production, since the graphql files are not deployed. | ||
* @returns the GraphQL schema | ||
*/ | ||
export async function loadSchemaFromFiles()/*: Promise<GraphQLSchema>*/ { | ||
return await loadGraphqlSchema('./server/**/*.graphql', { | ||
loaders: [new GraphQLFileLoader()], | ||
}) | ||
} | ||
|
||
export default defineNuxtModule({ | ||
setup(options, nuxt) { | ||
nuxt.hook('nitro:config', async (nitroConfig) => { | ||
// Register #graphql/schema virtual module | ||
nitroConfig.virtual = nitroConfig.virtual || {} | ||
nitroConfig.virtual['#graphql/schema'] = async () => { | ||
const schema = await loadSchemaFromFiles() | ||
return ` | ||
import { loadSchemaSync } from '@graphql-tools/load' | ||
import { GraphQLFileLoader } from '@graphql-tools/graphql-file-loader' | ||
export const schema = loadSchemaSync(\`${printSchema(schema)}\`, { | ||
loaders: [new GraphQLFileLoader()] | ||
}) | ||
` | ||
} | ||
}) | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
diff --git a/node_modules/h3/dist/index.cjs b/node_modules/h3/dist/index.cjs | ||
index 44af08c..1c74a78 100644 | ||
index e72fc41..e8dec25 100644 | ||
--- a/node_modules/h3/dist/index.cjs | ||
+++ b/node_modules/h3/dist/index.cjs | ||
@@ -193,7 +193,8 @@ function createError(input) { | ||
if (input instanceof H3Error) { | ||
@@ -243,7 +243,8 @@ function createError(input) { | ||
if (isError(input)) { | ||
return input; | ||
} | ||
- const err = new H3Error(input.message ?? input.statusMessage, input.cause ? { cause: input.cause } : void 0); | ||
+ // CHANGED: Workaround for https://github.com/nuxt-community/storybook/issues/377 | ||
+ const err = new H3Error(input.message !== null ? input.message : input.statusMessage, input.cause ? { cause: input.cause } : void 0); | ||
if (input.statusCode) { | ||
err.statusCode = input.statusCode; | ||
} | ||
if ("stack" in input) { | ||
try { | ||
Object.defineProperty(err, "stack", { get() { |
Oops, something went wrong.