payloadcms / payload

Payload is the open-source, fullstack Next.js framework, giving you instant backend superpowers. Get a full TypeScript backend and admin panel instantly. Use Payload as a headless CMS or for building powerful applications.
https://payloadcms.com
MIT License
24.63k stars 1.56k forks source link

Improving GraphQL extensions and documentation #2557

Closed paulpopus closed 1 year ago

paulpopus commented 1 year ago

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:

Additional Details

Before updating the docs I actually want to expose a few types and utilities from Payload's core.

The 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

ssyberg commented 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';

paulpopus commented 1 year ago

@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

revnelson commented 11 months 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';

Thank you for this! The documentation should really be updated until this is fixed.

github-actions[bot] commented 1 month ago

This issue has been automatically locked. Please open a new issue if this issue persists with any additional detail.