@tipe/nuxt-apollo-module
Advanced tools
Comparing version 0.0.6 to 3.0.1
{ | ||
"name": "@tipe/nuxt-apollo-module", | ||
"version": "0.0.6", | ||
"version": "3.0.1", | ||
"license": "MIT", | ||
"main": "index.js", | ||
"repository": "https://github.com/tipe/apollo-module", | ||
"homepage": "https://github.com/tipe/apollo-module", | ||
"repository": "https://github.com/nuxt-community/apollo-module", | ||
"homepage": "https://github.com/nuxt-community/apollo-module", | ||
"publishConfig": { | ||
@@ -9,0 +9,0 @@ "access": "public" |
@@ -15,3 +15,4 @@ import 'isomorphic-fetch' | ||
const { isDev, isClient, isServer, app, route, beforeNuxtRender, store } = ctx | ||
const { isDev, app, route, beforeNuxtRender, store } = ctx | ||
const isServer = (process.server !== undefined) ? process.server : ctx.isServer | ||
@@ -24,4 +25,4 @@ <% Object.keys(options.clientConfigs).forEach((key) => { %> | ||
const opts = isServer ? { | ||
ssrMode: true, | ||
cache: new InMemoryCache() | ||
ssrMode: true, | ||
cache: new InMemoryCache() | ||
} : { | ||
@@ -28,0 +29,0 @@ initialState: window.__NUXT__ ? window.__NUXT__.apollo.<%= key === 'default' ? 'defaultLink' : key %> : null, |
@@ -25,4 +25,4 @@ # Apollo | ||
apollo: { | ||
networkInterfaces: { | ||
default: '~/apollo/network-interfaces/default.js' | ||
clientConfigs: { | ||
default: '~/apollo/clientConfigs/default.js' | ||
} | ||
@@ -35,3 +35,3 @@ } | ||
- networkInterfaces: `Object` | ||
- clientConfig: `Object` Config passed to ApolloClient | ||
- default: `String` | ||
@@ -45,3 +45,3 @@ - [otherClient]: `String` or `Object` | ||
apollo: { | ||
networkInterfaces: { | ||
clientConfigs: { | ||
default: '~/apollo/network-interfaces/default.js', | ||
@@ -57,17 +57,16 @@ test: '~/apollo/network-interfaces/test.js' | ||
```js | ||
import { createNetworkInterface } from 'apollo-client' | ||
import { HttpLink } from 'apollo-link-http' | ||
import { InMemoryCache } from 'apollo-cache-inmemory' | ||
// make sure to export default | ||
export default (ctx) => { | ||
const networkInterface = createNetworkInterface({ | ||
uri: 'https://api.graph.cool/simple/v1/cj1dqiyvqqnmj0113yuqamkuu' | ||
}) | ||
// compose your Links here for the current client | ||
const appLink = new HttpLink({ uri: 'https://graphql-url.com' }) | ||
// here you can place your middleware. ctx has the context forwarded from Nuxt | ||
// you can return the networkInterface directly or return an object with additional | ||
// apollo-client options | ||
// return networkInterface | ||
// alternative return a object with constructor options of apollo-client | ||
// return the an object with additional apollo-client options | ||
return { | ||
networkInterface, | ||
link: appLink, | ||
cache: new InMemoryCache(), | ||
dataIdFromObject: o => o.id | ||
@@ -74,0 +73,0 @@ } |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
17643
8
250
0
76
1