
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
tiny-graphql-query-compiler
Advanced tools
`tiny-graphql-query-compiler` provides a JavaScript-land DSL for constructing GraphQL queries.
tiny-graphql-query-compiler provides a JavaScript-land DSL for constructing GraphQL queries.
Example:
import { compile } from "tiny-graphql-query-compiler";
const query = compile({
type: "query",
fields: {
id: true,
name: true,
age: true,
},
});
// query =>
`
query {
id
name
age
}
`;
To pass arguments, you can use the Call helper:
import { compile, Call } from "tiny-graphql-query-compiler";
const query = compile({
type: "query",
fields: {
user: Call(
{ id: 1 },
{
id: true,
name: true,
age: true,
}
),
},
});
// query =>
`
query {
user(id: 1) {
id
name
age
}
}
`;
To pass arguments using GraphQL variables, you can use the Call helper with the Var helper:
import { compile, Call, Var } from "tiny-graphql-query-compiler";
const query = compile({
type: "query",
fields: {
user: Call(
{ id: Var({ type: "ID!" }) },
{
id: true,
name: true,
age: true,
}
),
},
});
// query =>
`
query ($id: ID!) {
user(id: $id) {
id
name
age
}
}
`;
To get back a query and a set of variables to pass to that query, use the compileWithVariableValues function, and pass a value to each one of your variables:
import { compile, Call, Var } from "tiny-graphql-query-compiler";
const { query, variables } = compileWithVariableValues({
type: "query",
fields: {
user: Call(
{ id: Var({ type: "ID!", value: 1 }) },
{
id: true,
name: true,
age: true,
}
),
},
});
// query =>
`
query ($id: ID!) {
user(id: $id) {
id
name
age
}
}
`;
// variables =>
{
id: 1;
}
await someClient.execute({ query, variables });
FAQs
`tiny-graphql-query-compiler` provides a JavaScript-land DSL for constructing GraphQL queries.
We found that tiny-graphql-query-compiler 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
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.