Skip to content

add different examples to the resolver example #223

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

Merged
merged 1 commit into from
Oct 25, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Resources/doc/definitions/schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ Default files location
Yaml configuration
-------

For more examples on what can be done with Symfony Expression Language (the stuff after `@=`), check
[here](expression-language.md) and [here](http://symfony.com/doc/current/components/expression_language/syntax.html).

```yaml
# This is the type that will be the root of our query, and the
# entry point into our schema. It gives us the ability to fetch
Expand All @@ -43,7 +46,7 @@ Query:
episode:
description: "If omitted, returns the hero of the whole saga. If provided, returns the hero of that particular episode."
type: "Episode"
resolve: "@=resolver('character_hero', [args['episode']])"
resolve: "@=resolver('character_hero', [args['episode'].getId()])"
human:
type: "Human"
args:
Expand All @@ -57,7 +60,7 @@ Query:
id:
description: "id of the droid"
type: "String!"
resolve: "@=resolver('character_droid', [args['id']])"
resolve: "@=resolver('character_droid', [args])"
```

```yaml
Expand Down