Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
apollo-link-webextensions-messaging
Advanced tools
> Apollo link that, in a WebExtension, forwards GraphQL operations between processes
Apollo link that, in a WebExtension, forwards GraphQL operations between processes
npm i -S apollo-link-webextensions-messaging
reactive-graphql
and apollo-link-reactive-schema
Port
creation method: adaptable for cross-extension messaging or native messagingPort
(and esp. MessageSender
) in local GraphQL resolvers// ------------------
// in background page
import { createWebExtensionMessagingExecutorListener } from 'apollo-link-webextensions-messaging';
import { SchemaLink } from 'apollo-link-schema';
import schema from './path/to/your/schema';
// local schema execution
const link = new SchemaLink({
schema,
context: operation => ({
// `createWebExtensionMessagingExecutorListener` will
// add `port`, the `onConnect`'s `Port` as Operation's context
// we extract the `MessageSender` into GQL's context so that
// it can be used in resolvers
sender: operation.getContext().port.sender,
})
});
const listener = createWebExtensionMessagingExecutorListener({
link,
});
chrome.runtime.onConnect.addListener(listener);
// ----------------
// in content script
import { createWebExtensionsMessagingLink } from 'apollo-link-webextensions-messaging';
import { ApolloClient } from 'apollo-client';
import { InMemoryCache } from 'apollo-cache-inmemory';
const port = chrome.runtime.connect();
const client = new ApolloClient({
// can also be `createWebExtensionsMessagingLink((operation) => port)`
link: createWebExtensionsMessagingLink(port),
cache: new InMemoryCache(),
// from experience, if `queryDeduplication` is true,
// `client.watchQuery` unsubscription will not be
// properly passed down to the `link`
queryDeduplication: false,
});
client.query(MY_QUERY);
FAQs
> Apollo link that, in a WebExtension, forwards GraphQL operations between processes
The npm package apollo-link-webextensions-messaging receives a total of 5 weekly downloads. As such, apollo-link-webextensions-messaging popularity was classified as not popular.
We found that apollo-link-webextensions-messaging demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 open source maintainers 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.