9 lines
256 B
TypeScript
9 lines
256 B
TypeScript
|
import { graphql } from 'graphql'
|
||
|
|
||
|
import { schema } from '../../pages/api/graphql'
|
||
|
|
||
|
export default async function queryGraphql(query, variableValues = {}) {
|
||
|
const { data } = await graphql({ schema, source: query, variableValues })
|
||
|
return data || {}
|
||
|
}
|