Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: a really complicated schema #9

Closed
mattkrick opened this issue Jan 31, 2016 · 3 comments · May be fixed by #26
Closed

Feature request: a really complicated schema #9

mattkrick opened this issue Jan 31, 2016 · 3 comments · May be fixed by #26

Comments

@mattkrick
Copy link

Love the repo!
I'm looking for a schema that has all the tough stuff included. For example, something with:

  • Unions
  • Interfaces
  • Pagination
  • Nested pagination (eg get first 5 blog posts after cursor & last 5 comments for each sorted by time)
  • Circular reference pagination (eg most recent 5 books with inStock: true, show first 3 authors of each book, for each author show 5 most popular books)
  • Pagination where each result is a union type
  • ? Whatever else the community can think up

Underlying data isn't important, but it'd be nice to have a single place to get a little refresher on how I should shape my data when I'm building something.

Happy to help where I can!

@clayallsopp
Copy link
Owner

@mattkrick definitely - I actually thing GraphQL'izing the Facebook API might be a reasonable way to show all those?

maybe less ambitiously, the current Github implementation is relatively barebones, partly to avoid implementing more complex things like pagination (i.e. comments pagination, commits pagination, etc)

would love to see a contribution along those lines - Relay has good examples on pagination and more complex schemas, which might be good to mirror

@clayallsopp
Copy link
Owner

@mattkrick check out this: https://www.graphqlhub.com/playground?query=%23%20Welcome%20to%20GraphQLHub!%20Type%20your%20GraphQL%20query%20here%2C%20or%0A%23%20explore%20the%20%22Docs%22%20to%20the%20right%0A%0A%7B%0A%20%20hn2%20%7B%0A%20%20%20%20nodeFromHnId(id%3A%22rdl%22%2C%20isUserId%3Atrue)%20%7B%0A%20%20%20%20%20%20...%20on%20HackerNewsV2User%20%7B%0A%20%20%20%20%20%20%20%20submitted(first%3A%205)%20%7B%0A%20%20%20%20%20%20%20%20%20%20edges%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20node%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20...%20on%20HackerNewsV2Story%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20hnId%0A%09%09%09%09%09%09%09%09score%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20url%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20title%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20...%20on%20HackerNewsV2Comment%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20text%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kids(first%3A%202)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09edges%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09node%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09text%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20by%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09hnId%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20by%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20hnId%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20submitted(first%3A2)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20edges%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20node%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20...%20on%20HackerNewsV2Comment%20%7B%0A%09%09%09%09%09%09%09%09%09%09%09%09%09text%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09%09%09%09%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D

it has everything from your comment (pagination, circular references, interfaces) except union types. added in #28 and #29

@mattkrick
Copy link
Author

oh that is awesome! i can't imagine a practical use for nested pagination, but there it is! all we need now are some inline fragments inside some fragment spreads (or unions) & we've got the perfect playground for folks to build query tools with!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants