Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nuxt 4 compatibility #40

Merged
merged 8 commits into from
Oct 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .graphqlrc.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
schema: './playground/schema.graphql'
documents:
- './playground/pages/**/*.graphql'
- './playground/components/**/*.graphql'
- './playground/composables/**/*.graphql'
- './playground/plugins/**/*.graphql'
- './playground/app/pages/**/*.graphql'
- './playground/app/components/**/*.graphql'
- './playground/app/composables/**/*.graphql'
- './playground/app/plugins/**/*.graphql'
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
playground/schema.graphql
1 change: 1 addition & 0 deletions client/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
</template>

<script setup lang="ts">
import { ref, computed } from '#imports'
import { onDevtoolsClientConnected } from '@nuxt/devtools-kit/iframe-client'
import MiniSearch from 'minisearch'

Expand Down
2 changes: 1 addition & 1 deletion docs/configuration/full-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export default defineNuxtConfig({
})
```

## Full ~/app/graphqlMiddleware.serverOptions.ts example
## Full ~/server/graphqlMiddleware.serverOptions.ts example

```typescript
import { defineGraphqlServerOptions } from 'nuxt-graphql-middleware/dist/runtime/serverOptions'
Expand Down
11 changes: 6 additions & 5 deletions docs/configuration/server-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@

All dynamic configuration that deals with the server-side requests made to the
GraphQL server is located in a special runtime file located at
`~/app/graphqlMiddleware.serverOptions.ts`. This file is bundled together with
the nitro build in the .output folder.
`~/server/graphqlMiddleware.serverOptions.ts`. This file is bundled together
with the nitro build in the .output folder.

Create a file called `graphqlMiddleware.serverOptions.ts` (or js/mjs) inside the
`app` folder in your Nuxt root.
Create a file called `graphqlMiddleware.serverOptions.ts` inside the `serverDir`
of your Nuxt project. If you didn't specifically override this in your Nuxt
config this will be `./server`.

::: code-group

```typescript [~/app/graphqlMiddleware.serverOptions.ts]
```typescript [~/server/graphqlMiddleware.serverOptions.ts]
import { defineGraphqlServerOptions } from 'nuxt-graphql-middleware/dist/runtime/serverOptions'

export default defineGraphqlServerOptions({
Expand Down
2 changes: 1 addition & 1 deletion docs/configuration/using-auth-headers.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default defineNuxtConfig({
## For query/mutation requests at runtime

Define a `serverFetchOptions` callback in
`~/app/graphqlMiddleware.serverOptions.ts`. This method is called before a
`~/server/graphqlMiddleware.serverOptions.ts`. This method is called before a
GraphQL request is made.

```typescript
Expand Down
Loading
Loading