| Q | A
| ---------------- | -----
| Bug report? | no
| Feature request? | no
| BC Break report? | no
| RFC? | no
| Version/Branch | 0.12
I'm going to try define schema types using GraphQL schema language. Are there any examples for relay?
Hi @apoberez, the bundle don't have any helper for relay when using GraphQL schema language. You can combine yaml (for relay) and GraphQL schema language or define your relay directly using GraphQL schema language.
here an example of how this can be done with GraphQL schema language for Relay connection:
type Blog {
name: String!
}
"""A connection to a list of items."""
type BlogConnection {
"""Information to aid in pagination."""
pageInfo: PageInfo!
"""Information to aid in pagination."""
edges: [BlogEdge]
}
"""An edge in a connection."""
type BlogEdge {
"""The item at the end of the edge."""
node: Blog
"""A cursor for use in pagination."""
cursor: String!
}
Tips:
You can use yaml then dump the graphql equivalent using command:
bin/console graphql:dump-schema --file=php://stdout --format=graphql
Hi @mcg-web! Thanks!
Few tips from what I learned:
config/graphql/types/schema.types.graphql isn't full api schema. For example when using bin/console graphql:dump-schema --file=php://stdout --format=graphql PageInfo type will be added automatically.Overblog\GraphQLBundle\Relay\Connection\Paginator could be used same way as previously.Closing this issue. In case I'll have some new information I will add it here.