Custom Graphql query inputs
Hello,
Can someone please explain to me how to write custom Graphql queries?
We are using the Pothos library that autogenerates all of the CRUD resolvers.
I would like to use those queries for some basic create, update, and listings in the table.
I understand that @pankod/refine-graphql is not doing schema introspection and it is creating its own inputs
For a basic
query { barbers { id, name } }
It is creating
query ($sort: String, $where: JSON) { barbers (sort: $sort, where: $where) { id, name } }
I've tried to create my own query using gql-query-builder and set it to useTable metaData, but dataProvider is still adding* $sort: String, $where: JSON*
My question is, is it possible to use default dataProvider by just sending custom queries, or do I need to create a new dataProvider that will need to handle all the use cases of various queries/mutations and create a query for it inside that dataProvider?
There is no documentation for custom queries. I've found a couple of the same questions and didn't understand what was the solution to this.
https://discord.com/channels/837692625737613362/890159787621355521/979168892125581342
https://discord.com/channels/837692625737613362/890159787621355521/993207528575995984
My barbers query looks like this:
Query
barbers ( cursor BarberWhereUniqueInput, distinct [BarberScalarFieldEnum!], orderBy [BarberOrderByWithRelationInput!], skip Int, take Int, where BarberWhereInput ) [Barber!]!
And his where input like this:
BarberWhereInput
FIELDS
AND [BarberWhereInput!]
appointments AppointmentListRelationFilter
barberServices BarberServiceListRelationFilter
barberWorkTimeOverrides BarberWorkTimeOverrideListRelationFilter
barberWorkTimes BarberWorkTimeListRelationFilter
id StringFilter
name StringFilter
NOT [BarberWhereInput!]
OR [BarberWhereInput!]
password StringFilter
timeSlots TimeSlotListRelationFilter
type EnumBarberTypeFilter
username StringFilter
Can someone please explain to me how to write custom Graphql queries?
We are using the Pothos library that autogenerates all of the CRUD resolvers.
I would like to use those queries for some basic create, update, and listings in the table.
I understand that @pankod/refine-graphql is not doing schema introspection and it is creating its own inputs
For a basic
query { barbers { id, name } }
It is creating
query ($sort: String, $where: JSON) { barbers (sort: $sort, where: $where) { id, name } }
I've tried to create my own query using gql-query-builder and set it to useTable metaData, but dataProvider is still adding* $sort: String, $where: JSON*
My question is, is it possible to use default dataProvider by just sending custom queries, or do I need to create a new dataProvider that will need to handle all the use cases of various queries/mutations and create a query for it inside that dataProvider?
There is no documentation for custom queries. I've found a couple of the same questions and didn't understand what was the solution to this.
https://discord.com/channels/837692625737613362/890159787621355521/979168892125581342
https://discord.com/channels/837692625737613362/890159787621355521/993207528575995984
My barbers query looks like this:
Query
barbers ( cursor BarberWhereUniqueInput, distinct [BarberScalarFieldEnum!], orderBy [BarberOrderByWithRelationInput!], skip Int, take Int, where BarberWhereInput ) [Barber!]!
And his where input like this:
BarberWhereInput
FIELDS
AND [BarberWhereInput!]
appointments AppointmentListRelationFilter
barberServices BarberServiceListRelationFilter
barberWorkTimeOverrides BarberWorkTimeOverrideListRelationFilter
barberWorkTimes BarberWorkTimeListRelationFilter
id StringFilter
name StringFilter
NOT [BarberWhereInput!]
OR [BarberWhereInput!]
password StringFilter
timeSlots TimeSlotListRelationFilter
type EnumBarberTypeFilter
username StringFilter



