Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { params, query, types } from 'typed-graphqlify'
async function executeGraphql(gqlString: string): Promise {
return 0
}
const getUserQuery = {
getUser: {
user: params(
{ id: 1 },
{
id: types.number,
name: types.string,
bankAccount: {
id: types.number,
branch: types.string,
},
},
),
},
}
const gqlString = query(getUserQuery)
console.log(gqlString)
// =>
// query getUser(id: 1) {
// user {
// id
// name
// bankAccount {
// id
/* tslint:disable */
import { params, query, types } from 'typed-graphqlify'
async function executeGraphql(gqlString: string): Promise {
return 0
}
const getUserQuery = {
getUser: {
user: params(
{ id: 1 },
{
id: types.number,
name: types.string,
bankAccount: {
id: types.number,
branch: types.string,
},
},
),
},
}
const gqlString = query(getUserQuery)
console.log(gqlString)
// =>
// query getUser(id: 1) {
// user {
// id
const getVaultedInstrumentQuery = () => {
return {
id: types.string,
label: {
description: types.string
}
};
};
Object.keys(fields).reduce((result, key) => {
result[key] = types.string;
return result;
},{})
);
const getVaultedInstrumentQuery = () => {
return {
id: types.string,
label: {
description: types.string
}
};
};