I have some queries in *.gql files. I import them to a file then use print to convert them for axios. I wonder, is there any way that I could merge or combine these 2 queries into a query without apollo or any other npm packages?
# /user/account.gql
query userData {
Me {
id
email
level
avatar
first_name
last_name
}
}
# /ticket/list.gql
query ticketData ($id:ID,$offset:Int,$limit:Int) {
Tickets(id:$id, offset:$offset, limit:$limit, pagination:true ) {
id
status
title
updated_at
}
}
// Some JS file
import { print } from 'graphql/language/printer';
import userAcount from '../graphql/queries/user/acount.gql'
import ticketList from '../graphql/queries/tickets/list.gql'
const userAcountQuery = print(userAcount)
const ticketListQuery = print(ticketList)