Skip to content

Commit

Permalink
fix: properly export defineApolloClient utility
Browse files Browse the repository at this point in the history
Closes #608
  • Loading branch information
Diizzayy committed Mar 29, 2024
1 parent 6188a17 commit ec01878
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import { defineBuildConfig } from 'unbuild'

export default defineBuildConfig({
declaration: true,
entries: ['src/module'],
entries: ['src/module', 'src/config'],
externals: ['@nuxtjs/apollo']
})
2 changes: 1 addition & 1 deletion docs/content/1.getting-started/2.configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export default defineNuxtConfig({
})
```
```ts [apollo/other.ts]
import { defineApolloClient } from '@nuxtjs/apollo'
import { defineApolloClient } from '@nuxtjs/apollo/config'

export default defineApolloClient({
httpEndpoint: '',
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
".": {
"types": "./dist/types.d.ts",
"import": "./dist/module.mjs"
},
"./config": {
"types": "./dist/config.d.ts",
"import": "./dist/config.mjs"
}
},
"main": "./dist/module.mjs",
Expand Down
2 changes: 1 addition & 1 deletion playground/apollo/default.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineApolloClient } from '@nuxtjs/apollo'
import { defineApolloClient } from '@nuxtjs/apollo/config'

export default defineApolloClient({
// The GraphQL endpoint.
Expand Down
4 changes: 4 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import type { ClientConfig } from './types'

export type { ClientConfig }
export const defineApolloClient = (config: ClientConfig) => config

0 comments on commit ec01878

Please sign in to comment.