graphql schema example

Hi. I am trying to create my own graphql backend based on the graphql dataprovider that is provided by refine. Is there any graphql.schema example I can use for this purpose?
K
kapa.ai370d ago
Hi @_nirock. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Hmm, I don't know enough to give you a confident answer yet. However, you can refer to the refine GraphQL documentation (https://refine.dev/docs/guides-and-concepts/data-provider/graphql/) for more information on using GraphQL with refine. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
K
kapa.ai370d ago
<@335790220425297921> kapa.ai is still learning and improving, please let us how it did by reacting below
R
rare-sapphire370d ago
Okay. I have just found that the Graphql dataprovider is very, very basic and doesn't even support pagination.
G
genetic-orange370d ago
it has support pagination for pagination. if you found any missing feature please don't hesitate to open feature request on GitHub 🙏🏻
R
rare-sapphire370d ago
Please see line 44: https://github.com/refinedev/refine/blob/next/packages/graphql/src/dataProvider/index.ts#L44 The total counter is extracted from the received data. That means it will always return a number that is <= pagesize. I believe the graphql dataprovider is not production ready, but if I am missing anything please let me know.
GitHub
refine/index.ts at next · refinedev/refine
Build your React-based CRUD applications, without constraints. - refine/index.ts at next · refinedev/refine
G
genetic-orange369d ago
In this case, if the API does not return JSON in this format, then yes, pagination will not work. I suggest creating a data provider based on the needs of your own API. Our GraphQL data provider is like a boilerplate example. We also have Strapi-v4 and Hasura GraphQL data providers that work perfectly fine. However, if you have your own API, you can fork this example and customize it according to your needs.
R
rare-sapphire369d ago
The problem is different. Usually the data comes from one operation (Posts) and the total counter comes from another operation such as PostsMetadata. This way, we can pull 10 entries, but get the total number of entries. In this graphql adapter, it doesn't get a Metadata information, and in the total field it returns the number of entries pulled under this specific iteration. Strapi-v4 and Hasura Graphql does that properly. I am at a phase in the project where I can choose the Schema, so I am wondering if it will be a good idea to just mimic the Hasura or Strapi schema...
More Posts
Problem running refinefoods v4 demoHi, i used: npm create refine-app@latest -- --example finefoods-mui And when running in windows gdataproviderI have Hasura-Graphql on top of Postgres which I used in Refine Graphql data provider. I have a tablInferencer changeIt is possible to make changes in the Inferencer templates since my tables do not have the id columnupdate refine 4.10execute yarn run refine update to 4.10 and it no longer makes the queries it keeps loading the respoWhere is the best place to add an error handler for the automatic notifications of success/error?Hi guys, I have built a lot of things now and its time to add logic to the error notifications that using strapi v4 media uploader trying to get existing files getting a fileList errorwhen I use strapi media uploader and there is an existing file when I load my edit page I get the fowhat is the correct way to list media in the interface export when using strapi v4 media uploader?if I am using strapi with the media uploader, what would the correct way to list that media in the iHow to add custom page(like dashboard) in nextjs?i want to add a dashboard page in refine base-on nextjshow to configure refine to present the url in a sub directoryI have a project in refine which is installed in a sub directory (eg: http.site.com/subfolder). Howchange faviconhow about dev how can i change the favicon.icoSameSite attributeHi, Running the basic cli generated site with google login I get this error in the console. Indicahow do i import a refine ant table of admin panel as pdf can i do it just like how i do with normalhow do i import a refine ant table of admin panel as pdf can i do it just like how i do with normalHow to sort DataGrid of computed column?One of my columns in the MUI x-DataGrid is a computed column. When I attempt to click the header to One rangepicker to filter two lists using useSimpleListCan I use a single rangepicker to filter two lists using useSimpleList. For example if I submit a rarealTimehi all how I can get real-time updates for the data I use useTable hook to get the data, is there a Ant Design and mobile friendlyHello All! I have been developing a admin ui for my small personal company, and i came across a use Inferencer@kapa.ai please give more details on the fieldTransformer prop. How to use it and examples.MantineHeaderHow could you change the logo in the MantineHeader in mantine?How do I style the sidebar and its itemsHow do I style the sidebar and its items? I've looked at older answers but I don't really get it. I Differences between code generated using create-refine-app through yarn vs through npmHey all, just started learning about Refine today and went to start the tutorial using the headless