
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.
graphql-ts-client
Advanced tools
Generate fully typed Typescript clients for your GraphQL APIs.
yarn add graphql-ts-client
import { generateTypescriptClient } from 'graphql-ts-client'
generateTypescriptClient({
output: './myAwesomeApi.ts',
endpoint: 'https://my.awesome-api.com/graphql',
verbose: process.env.NODE_ENV === 'development', // when true, log requests to the console
headers: {
Authorization: 'Bearer 1234567890987654321',
},
})
import { myAwesomeApi, AssetType, Granularity, OnBoardingStage } from './myAwesomeApi'
async function somewhereOverTheRainbow() {
// Set an specific header if needed
myAwesomeApi.setHeader('Authorization', 'Bearer 010101010101')
// You can also change the API url
myAwesomeApi.setUrl('https://my-runtime-url.com/graphql')
// And configure how retrials should work
myAwesomeApi.setRetryConfig({
max: 3,
before: ({ queryName, query, variables, response }) => {
// do something before retrying
},
})
// Adding response listeners is also possible
myAwesomeApi.addResponseListener(({ queryName, query, variables, response }) => {
// do something whenever a request is responded
})
const response = await myAwesomeApi.queries.globalIndicators({
// Optionally you can define an alias for this request
__alias: 'myCustomGlobalIndicators',
__args: {
liveStatus: OnBoardingStage.COMPLETED,
assetType: AssetType.LEASED,
granularity: Granularity.DAILY,
},
customerExperience: {
avgRating: {
__args: {
from: '2020-01-01',
to: '2020-02-01',
},
},
},
lorem: true, // selected field
ipsum: true, // selected field
})
console.log(response.customerExperience.avgRating)
console.log(response.lorem)
console.log(response.ipsum)
console.log(response.dolor) // compilation time error
}
FAQs
GraphQL Typescript Client Generator
The npm package graphql-ts-client receives a total of 674 weekly downloads. As such, graphql-ts-client popularity was classified as not popular.
We found that graphql-ts-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.