Commit 51d90f6b authored by David Négrier's avatar David Négrier

Adding missing image + minor tweaks

parent d228309b
Pipeline #104046 passed with stages
in 5 minutes and 23 seconds
......@@ -85,6 +85,9 @@ interface UserInterface {
}
```
Of course, a PHP class implementing this PHP interface will translate into a GraphQL output type implementing the
GraphQL interface automatically!
## Autowiring services in resolvers
Some frameworks (Symfony in particular) can inject services directly in controller actions.
......@@ -152,7 +155,8 @@ return new JsonResponse([
]);
```
If you write your code like this, the `Product` class does not even know that it "has" a name anymore.
If you write your code like this, the notion of "product name" becomes external to the `Product` class. Looking at
the `Product` class code only, a developer does not even know that it "has" a name.
In GraphQLite 3, to do the same thing, you would have had to create an "external type", which led to having
fields declared in 2 classes. Same result in the end, your `Product` class is stripped from
......@@ -161,7 +165,10 @@ possessing a name. Autowiring allows you to keep all your fields in the same cla
## Validating user input
GraphQL input types can now be [validated using simple to use annotations](https://graphqlite.thecodingmachine.io/docs/next/validation).
The way you validate those will depend on the framework you are using, since we are tapping directly into your framework's
I must admit I was first reluctant to add validation to GraphQLite, but this was certainly the most requested feature.
So here we go! The way you validate those will depend on the framework you are using, since we are tapping directly into your framework's
validation library.
### In Laravel
......@@ -183,7 +190,7 @@ class MyController
### In Symfony
... or in any project (since you can use the symfony/validator component)
... or in any other framework (since you can use the symfony/validator component)
```php
/**
......@@ -463,7 +470,7 @@ enabled framework.
## What's next?
v4 is a bug milestone, but there is still a lot of work to be done.
v4 is a big milestone, but there is still a lot of work to be done.
In the coming months we plan to:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment