Akryum / Akryum/vue-cli-plugin-apollo

Add configuration for ClientAwareness to Doc

Đang mở
#496 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
477
Fork
109
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Since apollo-client [v2.4.7](https://github.com/apollographql/apollo-client/blob/main/CHANGELOG.md#apollo-client-247-1), client `name` and `version` for ClientAwareness added to ApolloClient. And Apollo Studio is Segmente metrics by this. I think additing how to set these options would be more helpful.

https://github.com/Akryum/vue-cli-plugin-apollo/blob/master/docs/guide/configuration.md

```diff
createApolloClient({
// URL to the HTTP API
httpEndpoint,
// Url to the Websocket API
wsEndpoint: null,
// Token used in localstorage
tokenName: 'apollo-token',
// Enable this if you use Query persisting with Apollo Engine
persisting: false,
// Or, advanced persisting options, see https://github.com/apollographql/apollo-link-persisted-queries#options
// Example:
// persisting: {
// generateHash: query => sha256()
// .update(print(query))
// .digest('hex'),
//},
// Is currently Server-Side Rendering or not
ssr: false,
// Only use Websocket for all requests (including queries and mutations)
websocketsOnly: false,
// Custom starting link.
// If you want to replace the default HttpLink, set `defaultHttpLink` to false
link: null,
// Custom pre-auth links
// Useful if you want, for example, to set a custom middleware for refreshing an access token.
preAuthLinks: [],
// If true, add the default HttpLink.
// Disable it if you want to replace it with a terminating link using `link` option.
defaultHttpLink: true,
// Options for the default HttpLink
httpLinkOptions: {},
// Custom Apollo cache implementation (default is apollo-cache-inmemory)
cache: null,
// Options for the default cache
inMemoryCacheOptions: {},
// Additional Apollo client options
- apollo: {},
+ apollo: {
+ name: 'client-name',
+ version: 'x.x'
+ },
// apollo-link-state options
clientState: null,
// Function returning Authorization header token
getAuth: defaultGetAuth,
})
```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.