
Security News
PyPI Expands Trusted Publishing to GitLab Self-Managed as Adoption Passes 25 Percent
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads
@alexlit/apollo-vue-kit
Advanced tools
Sample nuxt.js plugin (TypeScript + Apollo REST link)
import {
ApolloClient,
ApolloLink,
buildAxiosFetch,
InMemoryCache,
onError,
RestLink,
VueApollo,
} from '@alexlit/apollo-vue-kit';
import { formDataBodySerializer } from '@alexlit/apollo-vue-kit/body-serializers';
import type { Plugin } from '@nuxt/types';
import Vue from 'vue';
const API_HOST = 'https://example.com';
Vue.use(VueApollo);
/**
* @param context
* @param context.app
* @param context.$axios
*/
const vueApollo: Plugin = ({ app, $axios }) => {
/**
* Error
*/
const errorLink = onError(({ graphQLErrors, networkError }) => {
if (graphQLErrors) {
// silent
}
if (
networkError &&
`${networkError}` !== 'TypeError: forward is not a function'
) {
const { response, statusCode, result } = networkError as any;
console.error(
'[Apollo.plugin::onError.networkError]: ',
`${networkError}`,
{
response,
statusCode,
result,
},
);
}
});
/**
* Cache
*/
const cache = new InMemoryCache();
/**
* Rest
*/
const restLink = new RestLink({
uri: API_HOST,
/**
* Use axios plugin instead of vanilla fetch
*
* @param uri
* @param options
*/
customFetch: (uri, options) => {
return buildAxiosFetch($axios, (config) => {
/**
* Apollo formed header, for example, when using the 'bodySerializers' parameter
*/
const apolloHeaders: Record<string, string> = Object.fromEntries(
(options.headers as any).entries(),
);
config.headers = { ...config.headers, ...apolloHeaders };
return config;
})(uri, options);
},
bodySerializers: {
formData: formDataBodySerializer,
},
});
/**
* Client
*/
const defaultClient = new ApolloClient({
link: ApolloLink.from([errorLink, restLink]),
typeDefs: [],
resolvers: {},
cache,
});
/**
* Provider
*/
const apolloProvider = new VueApollo({
defaultClient,
});
app.apolloProvider = apolloProvider;
};
export default vueApollo;
FAQs
Apollo Vue Kit
The npm package @alexlit/apollo-vue-kit receives a total of 1 weekly downloads. As such, @alexlit/apollo-vue-kit popularity was classified as not popular.
We found that @alexlit/apollo-vue-kit demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.

Security News
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.