
Security News
Deno 2.6 + Socket: Supply Chain Defense In Your CLI
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.
relay-runtime
Advanced tools
A set of Relay APIs responsible for data fetching, reading and normalization of the GraphQL data.
Example:
// @flow strict-local
import type {FetchFunction} from 'relay-runtime';
const {
Environment,
Network,
Observable,
RecordSource,
Store,
fetchQuery,
graphql,
} = require('relay-runtime');
const fetchFn: FetchFunction = function (request, variables) {
return new Observable.create(source => {
fetch('/my-graphql-api', {
method: 'POST',
body: JSON.stringify({
text: request.text,
variables,
}),
})
.then(response => response.json())
.then(data => source.next(data));
});
};
const network = Network.create(fetchFn);
const store = new Store(new RecordSource());
const environment = new Environment({
network,
store,
});
fetchQuery(
environment,
graphql`
query AppQuery($id: ID!) {
user(id: $id) {
name
}
}
`,
{id: 'my-node-id'},
).subscribe({
error: error => {
console.error(error);
},
next: data => {
console.log(data);
},
});
For complete API reference, visit https://relay.dev/.
Apollo Client is a comprehensive state management library for JavaScript that enables you to manage both local and remote data with GraphQL. It is similar to relay-runtime in that it provides features for executing GraphQL operations, caching results, and updating the UI. Apollo Client is known for its flexibility and ease of integration with various view layers, not just React.
urql is a lightweight and extensible GraphQL client for React, designed to be highly customizable and easy to understand. It offers similar functionalities to relay-runtime, such as executing GraphQL queries and mutations, caching, and optimistic updates. urql differentiates itself with a focus on simplicity and a smaller bundle size.
graphql-request is a minimal GraphQL client for making HTTP requests. It is much simpler than relay-runtime and is suitable for small applications or simple use cases where the overhead of a full-featured GraphQL client is not necessary. It does not provide a caching layer or advanced features like subscriptions and optimistic updates.
FAQs
A core runtime for building GraphQL-driven applications.
The npm package relay-runtime receives a total of 3,779,490 weekly downloads. As such, relay-runtime popularity was classified as popular.
We found that relay-runtime demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.