Closed paulpopus closed 1 year ago
Not sure if I'm just missing something, but I had to explicitly import buildPaginated... to get the example working:
import buildPaginatedListType from 'payload/dist/graphql/schema/buildPaginatedListType';
@ssyberg Yeah, I can see the same issue. Can't figure out why it wouldn't be picked up, maybe someone at payload has a better idea? @denolfe
Not sure if I'm just missing something, but I had to explicitly import buildPaginated... to get the example working:
import buildPaginatedListType from 'payload/dist/graphql/schema/buildPaginatedListType';
Thank you for this! The documentation should really be updated until this is fixed.
This issue has been automatically locked. Please open a new issue if this issue persists with any additional detail.
Documentation Issue
I think documentation for extending GraphQL is lacking when it comes to covering a full customisation a user may realistically need. I covered some of this in my tutorial here https://nouance.io/articles/how-to-extend-graphql-in-payload-with-custom-queries-mutations-and-re-usable-types but I want to bring some of those examples and information into the official docs.
Parts that are confusing:
depth
argumentAdditional Details
Before updating the docs I actually want to expose a few types and utilities from Payload's core.
buildPaginatedListType
function(GraphQL: typeof ImportedGraphQL, payload: Payload) => Record<string, unknown>
import type { default as ImportedGraphQL } from 'graphql'
.graphQL.
object so that it can be properly re-used in custom queries, making the re-use of fragments in the frontend a lot easierThe goals here are to reduce friction in working with and extending GraphQL. Happy to work on this and add a PR for the code and documentation updates if there's a greenlight from the Payload team