WEBVTT 00:00:00.560 --> 00:00:03.360 thank you very much okay so let's get 00:00:02.480 --> 00:00:06.480 started 00:00:03.360 --> 00:00:09.599 so i already introduced my talk uh 00:00:06.480 --> 00:00:12.960 i'm gonna share my screen here 00:00:09.599 --> 00:00:13.679 and yeah so basically there will be 00:00:12.960 --> 00:00:15.920 three parts 00:00:13.679 --> 00:00:19.279 in this talk the first part is about the 00:00:15.920 --> 00:00:21.520 ecosystem the graphql ecosystem in php 00:00:19.279 --> 00:00:23.199 it does exist and it is actually quite 00:00:21.520 --> 00:00:26.240 large 00:00:23.199 --> 00:00:27.359 then how to choose the right library for 00:00:26.240 --> 00:00:29.920 your project 00:00:27.359 --> 00:00:30.480 if you're doing some php and finally a 00:00:29.920 --> 00:00:33.520 demo 00:00:30.480 --> 00:00:36.719 of graphqlite 00:00:33.520 --> 00:00:40.079 so um about the ecosystem 00:00:36.719 --> 00:00:42.000 well i'm sure all of you already know 00:00:40.079 --> 00:00:44.239 that when you're doing graphql you need 00:00:42.000 --> 00:00:45.600 a graphql client in the browser and a 00:00:44.239 --> 00:00:48.320 graphql middleware 00:00:45.600 --> 00:00:49.360 on the server side and you have actually 00:00:48.320 --> 00:00:52.480 implemented 00:00:49.360 --> 00:00:56.399 implementations of graphql middlewares 00:00:52.480 --> 00:00:59.039 in all in many languages 00:00:56.399 --> 00:01:00.000 of course not js it started there but 00:00:59.039 --> 00:01:03.039 also php 00:01:00.000 --> 00:01:06.320 java c-sharp or whatever 00:01:03.039 --> 00:01:10.080 today we're going to be zooming on php 00:01:06.320 --> 00:01:12.560 and if we have a look at the php 00:01:10.080 --> 00:01:13.360 graphical middlewares there are actually 00:01:12.560 --> 00:01:16.640 two kinds 00:01:13.360 --> 00:01:17.600 of uh such middlewares and i will split 00:01:16.640 --> 00:01:20.880 them 00:01:17.600 --> 00:01:23.920 a bit arbitrarily arbitrarily in two 00:01:20.880 --> 00:01:24.799 uh sections ones that i call core 00:01:23.920 --> 00:01:26.479 libraries 00:01:24.799 --> 00:01:27.920 and another that i call dropper 00:01:26.479 --> 00:01:30.880 libraries and 00:01:27.920 --> 00:01:31.439 core libraries are actually middlewares 00:01:30.880 --> 00:01:34.880 that are 00:01:31.439 --> 00:01:39.360 quite low level they are used to parse 00:01:34.880 --> 00:01:42.560 the graphical queries to serve 00:01:39.360 --> 00:01:45.280 the the the response in json 00:01:42.560 --> 00:01:45.920 they are really powerful but they are 00:01:45.280 --> 00:01:48.320 kind of 00:01:45.920 --> 00:01:50.000 hard to use the the developer the 00:01:48.320 --> 00:01:53.119 developer experience 00:01:50.000 --> 00:01:55.680 to use such uh library is 00:01:53.119 --> 00:01:56.479 kind of poor they're hard to use and so 00:01:55.680 --> 00:01:59.759 on top 00:01:56.479 --> 00:02:01.840 of those core libraries people build 00:01:59.759 --> 00:02:03.920 wrapper libraries which are actually 00:02:01.840 --> 00:02:06.399 libraries that use core libraries 00:02:03.920 --> 00:02:07.520 and that are more high level more 00:02:06.399 --> 00:02:10.160 opinionated 00:02:07.520 --> 00:02:12.720 certainly easier to use maybe not that 00:02:10.160 --> 00:02:15.200 not as much powerful as the call library 00:02:12.720 --> 00:02:16.400 but basically most of the time when you 00:02:15.200 --> 00:02:18.480 are doing an application 00:02:16.400 --> 00:02:20.640 you will be choosing a verbal diagram 00:02:18.480 --> 00:02:23.040 right 00:02:20.640 --> 00:02:24.239 in php if we have a look at core 00:02:23.040 --> 00:02:26.160 libraries 00:02:24.239 --> 00:02:28.160 there are not that many of them there 00:02:26.160 --> 00:02:31.360 are actually two right now 00:02:28.160 --> 00:02:33.120 there is webinaics which is the de facto 00:02:31.360 --> 00:02:35.760 standard in php 00:02:33.120 --> 00:02:38.160 almost everybody is using webinx and 00:02:35.760 --> 00:02:41.840 then there is a newcomer that is called 00:02:38.160 --> 00:02:44.640 ray welty which is developed by 00:02:41.840 --> 00:02:45.360 some russian guys it's an active 00:02:44.640 --> 00:02:48.640 development 00:02:45.360 --> 00:02:50.879 it looks really promising there is no 00:02:48.640 --> 00:02:54.560 solid documentation yet 00:02:50.879 --> 00:02:56.800 so uh right now if you 00:02:54.560 --> 00:02:57.760 need a co-library definitely go to 00:02:56.800 --> 00:03:00.959 webonix 00:02:57.760 --> 00:03:04.480 but keep an eye and high on 00:03:00.959 --> 00:03:06.879 railway there was in the past 00:03:04.480 --> 00:03:07.920 more libraries here there was one was 00:03:06.879 --> 00:03:10.879 that was called 00:03:07.920 --> 00:03:12.400 ushido that has been abandoned in favor 00:03:10.879 --> 00:03:14.239 of weaponix so 00:03:12.400 --> 00:03:16.480 right now it's pretty much robotics if 00:03:14.239 --> 00:03:19.840 you want a core library 00:03:16.480 --> 00:03:21.599 and then on top of this core library 00:03:19.840 --> 00:03:22.959 there are wrapper libraries and there 00:03:21.599 --> 00:03:26.239 are many of them 00:03:22.959 --> 00:03:28.879 and today uh 00:03:26.239 --> 00:03:29.760 all those libraries are using webonix 00:03:28.879 --> 00:03:32.239 under the hood 00:03:29.760 --> 00:03:35.200 okay it's a wrapper around webonix to 00:03:32.239 --> 00:03:38.480 make it easier to use 00:03:35.200 --> 00:03:40.879 so basically we have api platform and 00:03:38.480 --> 00:03:41.760 the overblock graphql bundles that are 00:03:40.879 --> 00:03:44.319 really 00:03:41.760 --> 00:03:46.400 used with the symphony framework if 00:03:44.319 --> 00:03:48.400 you're doing laravel you can use 00:03:46.400 --> 00:03:50.720 a library called lighthouse i will be 00:03:48.400 --> 00:03:52.300 presenting those a bit later 00:03:50.720 --> 00:03:54.080 if you're doing um 00:03:52.300 --> 00:03:56.959 [Music] 00:03:54.080 --> 00:03:59.280 what uh if you're using a cms like 00:03:56.959 --> 00:04:02.319 wordpress or drupal 00:03:59.280 --> 00:04:05.680 wordpress and drupal have modules 00:04:02.319 --> 00:04:08.879 to plug to present a graphql api 00:04:05.680 --> 00:04:10.560 so if you want to do a headless cms it's 00:04:08.879 --> 00:04:14.159 quite easy using 00:04:10.560 --> 00:04:16.880 wordpress or drupal and adding a 00:04:14.159 --> 00:04:17.759 a graphql module on them and then there 00:04:16.880 --> 00:04:19.440 is graphqlite 00:04:17.759 --> 00:04:21.199 which i've been altering for the last 00:04:19.440 --> 00:04:23.840 two years and which is 00:04:21.199 --> 00:04:24.240 a framework agnostic because you can use 00:04:23.840 --> 00:04:29.360 it 00:04:24.240 --> 00:04:32.320 whatever the framework you use 00:04:29.360 --> 00:04:32.720 let's make a quick look uh a quick zoom 00:04:32.320 --> 00:04:35.759 on 00:04:32.720 --> 00:04:37.520 webonix okay so webonix it is the core 00:04:35.759 --> 00:04:40.880 library here 00:04:37.520 --> 00:04:42.240 and how does it look like coding with 00:04:40.880 --> 00:04:45.360 webox well 00:04:42.240 --> 00:04:48.240 here i've got a graphql type okay 00:04:45.360 --> 00:04:48.639 and basically this type is a story it 00:04:48.240 --> 00:04:52.639 has 00:04:48.639 --> 00:04:55.680 fields with which all have types 00:04:52.639 --> 00:04:56.240 building that in webmix the card would 00:04:55.680 --> 00:04:59.280 look 00:04:56.240 --> 00:05:01.120 like this okay it's kind of verbose 00:04:59.280 --> 00:05:02.639 and as i told you the developer 00:05:01.120 --> 00:05:04.000 experience is not that great but 00:05:02.639 --> 00:05:08.240 basically 00:05:04.000 --> 00:05:11.840 i'm creating a type it's its name is 00:05:08.240 --> 00:05:14.880 history here and i've got a number of 00:05:11.840 --> 00:05:17.120 fields that are declared here with the 00:05:14.880 --> 00:05:19.280 type of the field the description 00:05:17.120 --> 00:05:20.800 if i've got arguments the arguments are 00:05:19.280 --> 00:05:23.120 declared here 00:05:20.800 --> 00:05:24.160 and finally i have a resolver that will 00:05:23.120 --> 00:05:26.639 be called 00:05:24.160 --> 00:05:27.360 when i query this fill the resolver is 00:05:26.639 --> 00:05:30.479 called 00:05:27.360 --> 00:05:33.919 to fetch the data 00:05:30.479 --> 00:05:33.919 this is really verbals right 00:05:34.320 --> 00:05:42.479 and also it might look a bit like 00:05:39.280 --> 00:05:44.720 some libraries some graphql libraries in 00:05:42.479 --> 00:05:46.080 javascript especially if you have been 00:05:44.720 --> 00:05:49.680 doing 00:05:46.080 --> 00:05:52.800 been using express graphql 00:05:49.680 --> 00:05:56.240 webonix started by mimicking a lot what 00:05:52.800 --> 00:05:59.440 facebook was doing in its own javascript 00:05:56.240 --> 00:06:03.120 library if i want to declare 00:05:59.440 --> 00:06:05.919 a query well i'm creating a type query 00:06:03.120 --> 00:06:07.600 whose fields are here it's actually 00:06:05.919 --> 00:06:08.000 exactly the same thing as defining a 00:06:07.600 --> 00:06:10.880 type 00:06:08.000 --> 00:06:11.440 because in graphql a query is a field on 00:06:10.880 --> 00:06:15.759 the 00:06:11.440 --> 00:06:18.000 type whose name is query and finally 00:06:15.759 --> 00:06:20.000 if i want to resolve a query i can 00:06:18.000 --> 00:06:20.800 compose the exit with query static 00:06:20.000 --> 00:06:23.440 method 00:06:20.800 --> 00:06:24.560 plus in parameters the schema the schema 00:06:23.440 --> 00:06:26.639 is 00:06:24.560 --> 00:06:28.080 an object containing all the types that 00:06:26.639 --> 00:06:31.039 i have declared 00:06:28.080 --> 00:06:32.880 i'm passing in the query string so the 00:06:31.039 --> 00:06:34.160 graphical query and it will return an 00:06:32.880 --> 00:06:37.840 array that that 00:06:34.160 --> 00:06:38.960 i can cast to json and return to the 00:06:37.840 --> 00:06:43.039 client 00:06:38.960 --> 00:06:45.440 so this is the the experience 00:06:43.039 --> 00:06:46.240 you're getting when you're using webinx 00:06:45.440 --> 00:06:49.599 directly 00:06:46.240 --> 00:06:50.479 right and the problem with this approach 00:06:49.599 --> 00:06:53.919 is that it 00:06:50.479 --> 00:06:57.759 actually requires a lot of work 00:06:53.919 --> 00:07:00.720 to set up a great graphql api 00:06:57.759 --> 00:07:01.759 obviously there are games to use graphql 00:07:00.720 --> 00:07:05.120 versus rest 00:07:01.759 --> 00:07:08.560 its queries are client-driven 00:07:05.120 --> 00:07:10.080 it has introspection you can see the 00:07:08.560 --> 00:07:12.639 schema from the client 00:07:10.080 --> 00:07:13.280 it has three types which is definitely 00:07:12.639 --> 00:07:15.840 one of the 00:07:13.280 --> 00:07:17.039 really cool features but if it is too 00:07:15.840 --> 00:07:20.880 much of pain to 00:07:17.039 --> 00:07:24.400 um to put the api in place 00:07:20.880 --> 00:07:26.880 uh well uh it maybe won't be worth it 00:07:24.400 --> 00:07:28.639 so what we are going to do is we are 00:07:26.880 --> 00:07:32.479 going to use a wrapper library 00:07:28.639 --> 00:07:36.560 which is easier to work with to 00:07:32.479 --> 00:07:39.759 offset the gains versus the costs 00:07:36.560 --> 00:07:42.319 and to make it worthwhile to use 00:07:39.759 --> 00:07:42.319 graphical 00:07:42.639 --> 00:07:46.639 now if we need to choose a proper 00:07:45.280 --> 00:07:50.000 library 00:07:46.639 --> 00:07:53.599 well there are basically two kinds of 00:07:50.000 --> 00:07:56.840 such libraries there are 00:07:53.599 --> 00:07:58.080 schema first libraries and code first 00:07:56.840 --> 00:08:00.960 libraries 00:07:58.080 --> 00:08:02.560 in the schema first dropper library 00:08:00.960 --> 00:08:04.879 basically 00:08:02.560 --> 00:08:06.080 your task as a developer will be to 00:08:04.879 --> 00:08:09.520 write the 00:08:06.080 --> 00:08:10.240 graphql schema and then the job of the 00:08:09.520 --> 00:08:13.599 library 00:08:10.240 --> 00:08:16.800 will be from the schema to build 00:08:13.599 --> 00:08:19.759 to to find a way to link the schema 00:08:16.800 --> 00:08:22.160 to the ph key code on the other end if 00:08:19.759 --> 00:08:25.440 you are using a code first approach 00:08:22.160 --> 00:08:28.240 you will be designing objects and then 00:08:25.440 --> 00:08:29.840 the job of the library will be to 00:08:28.240 --> 00:08:31.840 generate the schema 00:08:29.840 --> 00:08:34.080 from the classes and the objects you've 00:08:31.840 --> 00:08:37.279 been 00:08:34.080 --> 00:08:40.320 designing so uh 00:08:37.279 --> 00:08:41.120 and basically when you are using a 00:08:40.320 --> 00:08:45.519 language 00:08:41.120 --> 00:08:48.480 that is loosely typed you tend to have 00:08:45.519 --> 00:08:50.399 libraries that are schema first if you 00:08:48.480 --> 00:08:52.240 are doing javascript you will find a lot 00:08:50.399 --> 00:08:54.720 of schemas libraries 00:08:52.240 --> 00:08:56.320 on the other end if you are using a 00:08:54.720 --> 00:08:58.720 strictly typed language 00:08:56.320 --> 00:09:00.800 like java you will find a lot of code 00:08:58.720 --> 00:09:03.839 first libraries 00:09:00.800 --> 00:09:04.080 php sits a bit in the middle because it 00:09:03.839 --> 00:09:06.320 is 00:09:04.080 --> 00:09:07.600 optionally tight you can have types but 00:09:06.320 --> 00:09:09.040 you're not forced to 00:09:07.600 --> 00:09:10.959 and so you have the two kinds of 00:09:09.040 --> 00:09:14.160 libraries out there and 00:09:10.959 --> 00:09:16.880 uh basically uh in the schema first 00:09:14.160 --> 00:09:18.160 part you have uh overblog lighthouse 00:09:16.880 --> 00:09:21.519 reality sciler 00:09:18.160 --> 00:09:22.320 and the code first category api platform 00:09:21.519 --> 00:09:26.160 graphical light 00:09:22.320 --> 00:09:26.160 and get bob 00:09:26.880 --> 00:09:30.800 let's make a quick zoom on lighthouse 00:09:29.519 --> 00:09:33.680 okay so lighthouse 00:09:30.800 --> 00:09:36.320 is a schema first library let's see how 00:09:33.680 --> 00:09:41.040 it works 00:09:36.320 --> 00:09:43.440 lighthouse is built on top of laravel 00:09:41.040 --> 00:09:44.640 when you are using lighthouse what we 00:09:43.440 --> 00:09:47.839 you are going to do 00:09:44.640 --> 00:09:50.880 is you are going to design this 00:09:47.839 --> 00:09:54.399 graphql schema 00:09:50.880 --> 00:09:57.680 and basically you are going to annotate 00:09:54.399 --> 00:09:58.800 this schema with directives okay this is 00:09:57.680 --> 00:10:02.480 a directive 00:09:58.800 --> 00:10:05.360 this is another directive and 00:10:02.480 --> 00:10:06.560 these directives will be used uh by 00:10:05.360 --> 00:10:10.079 lighthouse 00:10:06.560 --> 00:10:12.399 to bind this schema to the database 00:10:10.079 --> 00:10:15.120 model directly 00:10:12.399 --> 00:10:16.560 uh basically under the hood lighthouse 00:10:15.120 --> 00:10:19.519 is using yellow points 00:10:16.560 --> 00:10:21.440 and yellow point is the orm of laravel 00:10:19.519 --> 00:10:24.480 so basically if i'm using the 00:10:21.440 --> 00:10:28.640 old directive 00:10:24.480 --> 00:10:32.240 automatically lighthouse will put 00:10:28.640 --> 00:10:32.800 the current user in the mcquery you can 00:10:32.240 --> 00:10:34.800 do 00:10:32.800 --> 00:10:36.640 quite powerful stuff with only 00:10:34.800 --> 00:10:38.160 directives for instance the create 00:10:36.640 --> 00:10:41.040 directive here 00:10:38.160 --> 00:10:42.480 will create directly an object in 00:10:41.040 --> 00:10:44.959 database 00:10:42.480 --> 00:10:46.880 when you when you call critpost and it 00:10:44.959 --> 00:10:49.519 will put a post directly into the 00:10:46.880 --> 00:10:52.959 database and you can do validation 00:10:49.519 --> 00:10:52.959 right here on each field 00:10:53.440 --> 00:11:01.120 okay so it's very efficient 00:10:57.839 --> 00:11:04.640 i mean you can build a complete 00:11:01.120 --> 00:11:06.640 graphql api in very few lines of code 00:11:04.640 --> 00:11:10.240 with this approach 00:11:06.640 --> 00:11:13.600 also it is very very tied to laravel 00:11:10.240 --> 00:11:14.000 and to eloquent which is the oram so if 00:11:13.600 --> 00:11:17.440 you want 00:11:14.000 --> 00:11:18.880 to do advanced things and if you don't 00:11:17.440 --> 00:11:21.440 want to 00:11:18.880 --> 00:11:22.399 to be too much tied to your database you 00:11:21.440 --> 00:11:25.200 will have to write 00:11:22.399 --> 00:11:26.399 a custom directive which is a bit of a 00:11:25.200 --> 00:11:28.480 pain 00:11:26.399 --> 00:11:29.839 but if you have a simple use case and 00:11:28.480 --> 00:11:31.920 you only want to 00:11:29.839 --> 00:11:33.920 back to to do quick by binding to a 00:11:31.920 --> 00:11:36.399 database it is a great tool 00:11:33.920 --> 00:11:38.640 okay one thing that is also interesting 00:11:36.399 --> 00:11:43.519 it has support for subscriptions 00:11:38.640 --> 00:11:46.880 which is uh so you can do real-time 00:11:43.519 --> 00:11:48.800 graph you graphql can 00:11:46.880 --> 00:11:51.839 can answer in real time which is not 00:11:48.800 --> 00:11:54.880 that common in php 00:11:51.839 --> 00:11:58.160 so that is lighthouse let's now make 00:11:54.880 --> 00:12:01.440 a zoom on api platform so api platform 00:11:58.160 --> 00:12:03.920 okay it is a code first library 00:12:01.440 --> 00:12:05.040 in api platform the philosophy is the 00:12:03.920 --> 00:12:08.480 opposite 00:12:05.040 --> 00:12:11.760 you start by writing a php class 00:12:08.480 --> 00:12:15.279 and then you're going to put annotations 00:12:11.760 --> 00:12:16.079 on the class an api platform will read 00:12:15.279 --> 00:12:18.880 the annotation 00:12:16.079 --> 00:12:19.920 and generate the graphical schema for 00:12:18.880 --> 00:12:23.360 you 00:12:19.920 --> 00:12:25.760 okay um api platform was 00:12:23.360 --> 00:12:26.800 first built with the rest philosophy in 00:12:25.760 --> 00:12:29.360 mind 00:12:26.800 --> 00:12:31.279 and uh what is kind of fun with the api 00:12:29.360 --> 00:12:34.079 platform is that you can expose 00:12:31.279 --> 00:12:35.600 quite easily both a rest api and a 00:12:34.079 --> 00:12:38.160 graphql api 00:12:35.600 --> 00:12:41.040 very few lines of code so you get both 00:12:38.160 --> 00:12:41.040 kind of api 00:12:41.440 --> 00:12:48.240 support using the same code 00:12:44.639 --> 00:12:52.240 which is cool however 00:12:48.240 --> 00:12:54.079 if you want to have a good control on 00:12:52.240 --> 00:12:56.079 you the graphical schema that is 00:12:54.079 --> 00:12:59.200 generated api platform 00:12:56.079 --> 00:13:01.839 may not be the best uh the best 00:12:59.200 --> 00:13:02.560 tool out there because the underlying 00:13:01.839 --> 00:13:05.360 philosophy 00:13:02.560 --> 00:13:07.279 is very much uh rest so you have credit 00:13:05.360 --> 00:13:08.639 you have you can create read update and 00:13:07.279 --> 00:13:12.560 delete the report 00:13:08.639 --> 00:13:16.240 if you want to do some some other things 00:13:12.560 --> 00:13:17.760 uh well it will be a bit harder to 00:13:16.240 --> 00:13:21.440 customize 00:13:17.760 --> 00:13:24.399 it has support for subscriptions too so 00:13:21.440 --> 00:13:24.639 yeah so that was the zoom on lighthouse 00:13:24.399 --> 00:13:26.720 and 00:13:24.639 --> 00:13:28.240 api platform there are many also 00:13:26.720 --> 00:13:31.760 libraries out there 00:13:28.240 --> 00:13:34.079 and i've been preparing a few schemas 00:13:31.760 --> 00:13:34.880 to help you decide what library you can 00:13:34.079 --> 00:13:37.360 use 00:13:34.880 --> 00:13:40.160 by answering a few questions so let's 00:13:37.360 --> 00:13:40.160 jump into that 00:13:40.560 --> 00:13:44.000 so basically if you want to pick a 00:13:42.800 --> 00:13:46.399 graphical library 00:13:44.000 --> 00:13:48.560 i think the first que and if you are 00:13:46.399 --> 00:13:51.519 doing php 00:13:48.560 --> 00:13:52.399 the first question you should ask is are 00:13:51.519 --> 00:13:55.680 you developing 00:13:52.399 --> 00:13:59.040 an application or a tool okay 00:13:55.680 --> 00:14:02.560 so basically um 00:13:59.040 --> 00:14:05.760 if you are 00:14:02.560 --> 00:14:06.399 doing uh if you are developing a tool if 00:14:05.760 --> 00:14:09.600 your model 00:14:06.399 --> 00:14:14.320 is dynamic for instance if uh 00:14:09.600 --> 00:14:16.720 you're sorry 00:14:14.320 --> 00:14:17.519 if you are developing a cms and the end 00:14:16.720 --> 00:14:20.000 user 00:14:17.519 --> 00:14:20.959 can create a new content type you can 00:14:20.000 --> 00:14:23.199 create new type 00:14:20.959 --> 00:14:24.720 add new fields stuff like that then you 00:14:23.199 --> 00:14:26.959 want to go for webinars 00:14:24.720 --> 00:14:28.000 okay you want to go low level and build 00:14:26.959 --> 00:14:29.920 your own tool 00:14:28.000 --> 00:14:31.279 on it if you are developing an 00:14:29.920 --> 00:14:31.760 application and you have a set of 00:14:31.279 --> 00:14:35.120 classes 00:14:31.760 --> 00:14:38.160 already well defined then you want to go 00:14:35.120 --> 00:14:38.720 for a wrapper library then there is a 00:14:38.160 --> 00:14:41.760 question 00:14:38.720 --> 00:14:42.399 do you need subscriptions if you want to 00:14:41.760 --> 00:14:45.519 do things 00:14:42.399 --> 00:14:47.680 in real time then you have to pick 00:14:45.519 --> 00:14:48.959 a library that supports subscriptions 00:14:47.680 --> 00:14:51.360 there are not many out there 00:14:48.959 --> 00:14:52.399 it's lighthouse api platform silo of all 00:14:51.360 --> 00:14:55.519 webinars 00:14:52.399 --> 00:14:58.160 otherwise you can choose any library 00:14:55.519 --> 00:14:59.040 then there is another question which is 00:14:58.160 --> 00:15:02.880 do you want 00:14:59.040 --> 00:15:06.079 do you want to do do you want to use 00:15:02.880 --> 00:15:09.279 relay on your front end if you are 00:15:06.079 --> 00:15:11.600 using relay a relay imposes 00:15:09.279 --> 00:15:13.760 a number of constraints of the on the 00:15:11.600 --> 00:15:16.399 schemas that are generated 00:15:13.760 --> 00:15:17.199 and not all the libraries out there have 00:15:16.399 --> 00:15:20.720 support for 00:15:17.199 --> 00:15:23.279 this kind of schema so if you want to do 00:15:20.720 --> 00:15:24.720 to use relay you should definitely aim 00:15:23.279 --> 00:15:28.639 for those libraries 00:15:24.720 --> 00:15:31.040 maybe lighthouse and graphical bundles 00:15:28.639 --> 00:15:32.000 finally depending on the framework you 00:15:31.040 --> 00:15:35.440 are using 00:15:32.000 --> 00:15:38.839 you will also have to to put to pick 00:15:35.440 --> 00:15:42.320 one of those 00:15:38.839 --> 00:15:45.279 libraries some libraries 00:15:42.320 --> 00:15:46.880 are framework agnostics like webinarics 00:15:45.279 --> 00:15:50.720 and graphic lite and you can use them 00:15:46.880 --> 00:15:54.480 everywhere alright so 00:15:50.720 --> 00:15:56.079 finally the last question do you prefer 00:15:54.480 --> 00:15:59.360 a schema first or 00:15:56.079 --> 00:16:02.480 a code first approach if you want 00:15:59.360 --> 00:16:04.800 to go schema first pick one here 00:16:02.480 --> 00:16:05.759 if you want to go code first pick one 00:16:04.800 --> 00:16:09.040 here 00:16:05.759 --> 00:16:11.600 and when you unsword all those questions 00:16:09.040 --> 00:16:14.160 if you are lucky well you still have a 00:16:11.600 --> 00:16:16.000 choice between one or two libraries 00:16:14.160 --> 00:16:17.759 if you are unlucky there are no 00:16:16.000 --> 00:16:20.240 libraries uh 00:16:17.759 --> 00:16:22.240 answering you need for instance if you 00:16:20.240 --> 00:16:26.639 want uh to do 00:16:22.240 --> 00:16:29.759 to use a code first approach in laravel 00:16:26.639 --> 00:16:33.279 and using subscriptions well 00:16:29.759 --> 00:16:36.560 you can't basically 00:16:33.279 --> 00:16:39.440 and but yes this 00:16:36.560 --> 00:16:41.120 approach should help you choose uh one 00:16:39.440 --> 00:16:44.240 of those libraries 00:16:41.120 --> 00:16:47.839 okay and uh i try to be 00:16:44.240 --> 00:16:52.079 not too much biased but yes of course i 00:16:47.839 --> 00:16:54.800 i altered a graphic light and so well 00:16:52.079 --> 00:16:55.519 now we will enter the third phase of 00:16:54.800 --> 00:16:58.320 this talk 00:16:55.519 --> 00:16:59.759 and i will be doing a quick demo about 00:16:58.320 --> 00:17:03.040 graphic light 00:16:59.759 --> 00:17:04.799 before doing the demo i will try to 00:17:03.040 --> 00:17:08.079 explain you the philosophy 00:17:04.799 --> 00:17:11.839 that drove a graphical light basically 00:17:08.079 --> 00:17:15.760 my id was uh well let's imagine 00:17:11.839 --> 00:17:18.959 you want to do a simple echo query 00:17:15.760 --> 00:17:22.079 in php okay 00:17:18.959 --> 00:17:26.240 if you want to do such a query 00:17:22.079 --> 00:17:29.679 in graphql it will look like this i'm 00:17:26.240 --> 00:17:33.520 creating a query type and basically 00:17:29.679 --> 00:17:37.919 yes there is a echo it takes a message 00:17:33.520 --> 00:17:41.120 it will return um well i 00:17:37.919 --> 00:17:44.880 i'm doing an echo to build that 00:17:41.120 --> 00:17:47.520 using webonix i would need to put cisco 00:17:44.880 --> 00:17:48.480 i already presented it i need to put an 00:17:47.520 --> 00:17:50.480 echo field 00:17:48.480 --> 00:17:51.919 which returns a string that takes into 00:17:50.480 --> 00:17:54.240 argument a string 00:17:51.919 --> 00:17:57.200 and and that results by reading the 00:17:54.240 --> 00:18:00.240 arguments and returning them 00:17:57.200 --> 00:18:01.600 but if i want to write the same echo in 00:18:00.240 --> 00:18:06.400 pure php 00:18:01.600 --> 00:18:09.840 basically it only takes four lines 00:18:06.400 --> 00:18:13.520 basically the function name could map 00:18:09.840 --> 00:18:16.640 the query name in graphql the parameters 00:18:13.520 --> 00:18:19.200 here could 00:18:16.640 --> 00:18:20.880 map graphical arguments and the return 00:18:19.200 --> 00:18:22.640 type is already defined 00:18:20.880 --> 00:18:24.799 and then the body of the function is 00:18:22.640 --> 00:18:28.400 actually my resolver 00:18:24.799 --> 00:18:31.200 so what would be really cool 00:18:28.400 --> 00:18:32.000 would be what if i was able to simply 00:18:31.200 --> 00:18:35.200 put 00:18:32.000 --> 00:18:39.120 a query annotation here 00:18:35.200 --> 00:18:42.880 and well this query annotation 00:18:39.120 --> 00:18:46.000 uh would automatically 00:18:42.880 --> 00:18:46.480 tell my library graphically like in my 00:18:46.000 --> 00:18:50.000 case 00:18:46.480 --> 00:18:52.160 that this function should be actually 00:18:50.000 --> 00:18:53.360 a graphical query expose it in graphql 00:18:52.160 --> 00:18:56.320 that's it 00:18:53.360 --> 00:18:58.720 and so that's the philosophy behind 00:18:56.320 --> 00:19:02.240 graphqlite using annotations 00:18:58.720 --> 00:19:06.160 and using the fact that php 00:19:02.240 --> 00:19:09.440 is already typed and 00:19:06.160 --> 00:19:10.160 basically taking php types and mapping 00:19:09.440 --> 00:19:13.200 them 00:19:10.160 --> 00:19:15.120 automatically to graphical types so 00:19:13.200 --> 00:19:17.440 this is graphic light graphicalite is a 00:19:15.120 --> 00:19:20.960 mapper between php types 00:19:17.440 --> 00:19:23.679 and graphql types and 00:19:20.960 --> 00:19:25.679 what is kind of fun is that it actually 00:19:23.679 --> 00:19:29.120 plays quite nice with doctrine 00:19:25.679 --> 00:19:32.240 okay doctrine is the orm 00:19:29.120 --> 00:19:34.480 used by a symphony 00:19:32.240 --> 00:19:37.120 and basically in doctrine you put 00:19:34.480 --> 00:19:40.080 annotations in your php objects 00:19:37.120 --> 00:19:41.280 and doctrine is doing a mapping between 00:19:40.080 --> 00:19:44.000 php objects 00:19:41.280 --> 00:19:44.720 and database tables and from the php 00:19:44.000 --> 00:19:47.520 objects 00:19:44.720 --> 00:19:49.200 it can generate the database model and 00:19:47.520 --> 00:19:49.600 with graphilite we are doing the same 00:19:49.200 --> 00:19:52.720 thing 00:19:49.600 --> 00:19:56.559 we are starting from the php object and 00:19:52.720 --> 00:19:56.559 we are generating a graphql schema 00:19:57.280 --> 00:20:03.760 yeah so let's go for the live coding 00:20:01.840 --> 00:20:05.679 quick note i already told it is 00:20:03.760 --> 00:20:08.960 framework agnostic 00:20:05.679 --> 00:20:12.240 you can use it starting from php 7.2 00:20:08.960 --> 00:20:12.240 and it's based on webonix 00:20:13.440 --> 00:20:20.960 now for the hard part for me 00:20:17.039 --> 00:20:23.679 the demo yeah so we are going 00:20:20.960 --> 00:20:26.559 to uh make a quick demo with a 00:20:23.679 --> 00:20:29.760 marketplace and basically my marketplace 00:20:26.559 --> 00:20:33.200 has companies and in each company 00:20:29.760 --> 00:20:36.159 can have several products and we will be 00:20:33.200 --> 00:20:37.520 focusing on this relationship between 00:20:36.159 --> 00:20:40.720 companies and products 00:20:37.520 --> 00:20:44.000 in the last uh in the next five minutes 00:20:40.720 --> 00:20:48.480 right so 00:20:44.000 --> 00:20:52.559 let's jump to the code here 00:20:48.480 --> 00:20:55.760 i already did set up a 00:20:52.559 --> 00:20:58.080 graphql a graphical light in 00:20:55.760 --> 00:20:59.360 a symphony project the database is 00:20:58.080 --> 00:21:03.520 already loaded 00:20:59.360 --> 00:21:06.640 and i wrote a company controller okay so 00:21:03.520 --> 00:21:10.720 it's actually a controller like like 00:21:06.640 --> 00:21:13.600 like you can find some in nbc frameworks 00:21:10.720 --> 00:21:14.240 except it is in the graphql controller 00:21:13.600 --> 00:21:16.640 namespace 00:21:14.240 --> 00:21:18.000 okay and if you want to put queries or 00:21:16.640 --> 00:21:19.840 mutations 00:21:18.000 --> 00:21:21.440 somewhere in your code you will put them 00:21:19.840 --> 00:21:23.760 in a controller 00:21:21.440 --> 00:21:24.799 so my controller is fed with a company 00:21:23.760 --> 00:21:27.440 repository 00:21:24.799 --> 00:21:28.960 the company repository is the object 00:21:27.440 --> 00:21:33.200 that will access the database 00:21:28.960 --> 00:21:35.120 okay and i have this 00:21:33.200 --> 00:21:36.559 method which is called get companies 00:21:35.120 --> 00:21:39.039 that takes 00:21:36.559 --> 00:21:40.880 a search string and that will query the 00:21:39.039 --> 00:21:42.080 database for the string and return the 00:21:40.880 --> 00:21:44.559 results 00:21:42.080 --> 00:21:45.520 what i'm going to do is i'm going to put 00:21:44.559 --> 00:21:50.080 an annotation 00:21:45.520 --> 00:21:53.120 here and 00:21:50.080 --> 00:21:55.440 i'm going to put a query annotation to 00:21:53.120 --> 00:21:57.980 tell graphic life okay 00:21:55.440 --> 00:22:00.640 take this company's 00:21:57.980 --> 00:22:03.600 [Music] 00:22:00.640 --> 00:22:05.760 function and expose it in the graphql 00:22:03.600 --> 00:22:08.720 schema 00:22:05.760 --> 00:22:10.400 if i go in firefox here i've got a 00:22:08.720 --> 00:22:12.960 graphical 00:22:10.400 --> 00:22:13.679 test client setup so i'm going to 00:22:12.960 --> 00:22:17.600 refresh 00:22:13.679 --> 00:22:20.799 the page and oops 00:22:17.600 --> 00:22:24.400 okay i'm getting an error let's make 00:22:20.799 --> 00:22:28.480 a quick zoom on this error and basically 00:22:24.400 --> 00:22:32.080 what graphicality is telling me is that 00:22:28.480 --> 00:22:35.760 in the get companies method a type hint 00:22:32.080 --> 00:22:39.280 is missing okay you remember 00:22:35.760 --> 00:22:41.600 that php is optionally typed but graphql 00:22:39.280 --> 00:22:44.240 must have types so when i'm using 00:22:41.600 --> 00:22:47.600 graphqlite i must put type 00:22:44.240 --> 00:22:50.960 into all my functions uh 00:22:47.600 --> 00:22:53.679 all my queries here i did not define 00:22:50.960 --> 00:22:54.000 any return type so i need to define one 00:22:53.679 --> 00:22:57.520 so 00:22:54.000 --> 00:23:00.000 i'm going to say company get companies 00:22:57.520 --> 00:23:01.440 is returning an array of companies now i 00:23:00.000 --> 00:23:04.320 have a problem 00:23:01.440 --> 00:23:06.720 it's that php does not have the notion 00:23:04.320 --> 00:23:08.400 of generics so i cannot say something 00:23:06.720 --> 00:23:11.679 like okay it's an array of company 00:23:08.400 --> 00:23:12.559 this is not valid php right so what i'm 00:23:11.679 --> 00:23:16.320 gonna do 00:23:12.559 --> 00:23:19.440 is i'm going to put an uh 00:23:16.320 --> 00:23:22.559 a code a command in the php doc and 00:23:19.440 --> 00:23:23.280 in the php dock i can put anything and 00:23:22.559 --> 00:23:27.360 especially 00:23:23.280 --> 00:23:29.360 i will give a type hint to uh 00:23:27.360 --> 00:23:31.120 to graph the light and tell him that 00:23:29.360 --> 00:23:35.760 this array is actually 00:23:31.120 --> 00:23:39.520 an array of companies so let's go back 00:23:35.760 --> 00:23:43.120 to firefox refresh the page 00:23:39.520 --> 00:23:46.880 and oh i'm getting another error 00:23:43.120 --> 00:23:49.360 okay let's zoom on this lever 00:23:46.880 --> 00:23:50.480 it's error driven development i'm a big 00:23:49.360 --> 00:23:54.960 fan of ever 00:23:50.480 --> 00:23:58.720 driven development it works really well 00:23:54.960 --> 00:24:01.120 no i and i actually tried to 00:23:58.720 --> 00:24:03.200 make sure that all the error messages 00:24:01.120 --> 00:24:06.480 are quite clear 00:24:03.200 --> 00:24:09.760 it's really important and well 00:24:06.480 --> 00:24:12.480 in your own code try uh to pay attention 00:24:09.760 --> 00:24:13.760 on the other messages you are generating 00:24:12.480 --> 00:24:17.360 you are doing 00:24:13.760 --> 00:24:19.840 your future self favor uh yeah 00:24:17.360 --> 00:24:21.360 so basically it's telling me that in get 00:24:19.840 --> 00:24:24.480 companies 00:24:21.360 --> 00:24:26.400 it cannot map the class company to a 00:24:24.480 --> 00:24:28.320 known required type 00:24:26.400 --> 00:24:30.559 what graduality is actually tell me 00:24:28.320 --> 00:24:34.720 telling me is that i did not tell 00:24:30.559 --> 00:24:38.080 him explicitly that company 00:24:34.720 --> 00:24:40.559 is a graphical type and so to do that 00:24:38.080 --> 00:24:42.720 i simply add an annotation which is the 00:24:40.559 --> 00:24:46.000 type annotation 00:24:42.720 --> 00:24:48.080 and the type annotation is 00:24:46.000 --> 00:24:49.679 telling graphical life okay map this 00:24:48.080 --> 00:24:52.799 class to a tie 00:24:49.679 --> 00:24:53.679 of course a type must have some face so 00:24:52.799 --> 00:24:58.000 i'm going to 00:24:53.679 --> 00:25:01.279 put annotations in the in the gators 00:24:58.000 --> 00:25:04.320 here and i'm going to say okay expose 00:25:01.279 --> 00:25:07.520 id as a fill and name 00:25:04.320 --> 00:25:10.320 as a field and maybe website 00:25:07.520 --> 00:25:10.880 as a field too also notice that i'm 00:25:10.320 --> 00:25:14.080 putting 00:25:10.880 --> 00:25:16.480 the field annotation on getters i'm not 00:25:14.080 --> 00:25:19.440 putting the annotation 00:25:16.480 --> 00:25:23.520 on the properties the properties are are 00:25:19.440 --> 00:25:23.520 private so i cannot access them directly 00:25:23.919 --> 00:25:27.360 doctrine has annotation on properties 00:25:26.880 --> 00:25:29.679 because 00:25:27.360 --> 00:25:30.480 it is doing some black magic and 00:25:29.679 --> 00:25:33.120 actually 00:25:30.480 --> 00:25:34.960 accessing directly private properties 00:25:33.120 --> 00:25:38.159 i'm not doing that in graphic light 00:25:34.960 --> 00:25:39.919 okay so yes i must put the fill 00:25:38.159 --> 00:25:43.520 annotation on the getters 00:25:39.919 --> 00:25:46.640 so let's go back to 00:25:43.520 --> 00:25:50.159 graphical i'm refreshing the page 00:25:46.640 --> 00:25:53.440 i don't have any error so it looks good 00:25:50.159 --> 00:25:56.799 and if i'm looking at writing a query 00:25:53.440 --> 00:26:00.480 i can my company pool will just appear 00:25:56.799 --> 00:26:02.640 and yeah i can do a search on any 00:26:00.480 --> 00:26:05.200 companies containing the a 00:26:02.640 --> 00:26:06.320 and i'm going to display the id and the 00:26:05.200 --> 00:26:10.000 name 00:26:06.320 --> 00:26:10.799 place the request and it is working and 00:26:10.000 --> 00:26:14.960 if i'm 00:26:10.799 --> 00:26:18.960 adding the website right 00:26:14.960 --> 00:26:20.640 good so basically you can see that i 00:26:18.960 --> 00:26:23.840 managed to create 00:26:20.640 --> 00:26:24.880 a graphql api by basically adding three 00:26:23.840 --> 00:26:28.960 annotations 00:26:24.880 --> 00:26:32.480 query type and fill which is pretty cool 00:26:28.960 --> 00:26:35.600 um and yeah 00:26:32.480 --> 00:26:37.919 let's so far i only fetched 00:26:35.600 --> 00:26:39.600 fields from companies so let's do some 00:26:37.919 --> 00:26:43.200 binding with a product 00:26:39.600 --> 00:26:47.600 so i'm going to go in the get products 00:26:43.200 --> 00:26:50.640 getter and i'm gonna add a field on it 00:26:47.600 --> 00:26:53.440 i'm gonna refresh the page 00:26:50.640 --> 00:26:55.120 and i'm getting another evolve if i'm 00:26:53.440 --> 00:26:57.120 zooming on this error 00:26:55.120 --> 00:26:58.320 it is telling me that it cannot map the 00:26:57.120 --> 00:27:01.600 product class 00:26:58.320 --> 00:27:02.640 to a known graphical type okay we 00:27:01.600 --> 00:27:06.000 already saw 00:27:02.640 --> 00:27:08.159 this error two minutes ago so i'm pretty 00:27:06.000 --> 00:27:09.919 sure you know what i should do i should 00:27:08.159 --> 00:27:12.880 go in the product class 00:27:09.919 --> 00:27:14.159 and instruct graphicalize that the 00:27:12.880 --> 00:27:17.440 product 00:27:14.159 --> 00:27:19.600 class is also a tie 00:27:17.440 --> 00:27:22.080 and so i'm putting a type here and i'm 00:27:19.600 --> 00:27:22.080 going to 00:27:22.399 --> 00:27:29.520 put a field annotation 00:27:26.480 --> 00:27:32.840 on the id on the name 00:27:29.520 --> 00:27:34.559 on the price on the margin of the 00:27:32.840 --> 00:27:38.559 product and 00:27:34.559 --> 00:27:38.559 if i'm refreshing the page 00:27:38.720 --> 00:27:43.360 yeah everything seems to be going great 00:27:40.799 --> 00:27:46.840 and i can access the products 00:27:43.360 --> 00:27:48.720 and access the id and the name of the 00:27:46.840 --> 00:27:52.320 product 00:27:48.720 --> 00:27:55.600 and it's working yeah 00:27:52.320 --> 00:27:59.200 so that's it and basically 00:27:55.600 --> 00:28:02.080 my job when i set up a graphql api 00:27:59.200 --> 00:28:02.640 becomes adding a few annotations and 00:28:02.080 --> 00:28:05.039 yeah 00:28:02.640 --> 00:28:05.039 that's it 00:28:05.679 --> 00:28:13.039 so yeah for the live demo 00:28:09.600 --> 00:28:15.520 i won't be going any further i will be 00:28:13.039 --> 00:28:16.080 presenting you very quickly a few 00:28:15.520 --> 00:28:20.000 additional 00:28:16.080 --> 00:28:22.240 features for instance if you want to put 00:28:20.000 --> 00:28:23.679 to create a mutation you have a mutation 00:28:22.240 --> 00:28:25.760 annotation 00:28:23.679 --> 00:28:27.440 that can be used to create a mutation it 00:28:25.760 --> 00:28:30.880 works exactly the same as 00:28:27.440 --> 00:28:32.799 the query annotation works 00:28:30.880 --> 00:28:35.279 there is a brilliant support for 00:28:32.799 --> 00:28:37.360 authentication and authorization 00:28:35.279 --> 00:28:38.480 that is plugged into your favorite 00:28:37.360 --> 00:28:41.600 framework 00:28:38.480 --> 00:28:43.440 laravel symphony whatever but basically 00:28:41.600 --> 00:28:47.520 if you are using the right annotation 00:28:43.440 --> 00:28:50.880 and passing the name of a write 00:28:47.520 --> 00:28:54.399 well then this query will be 00:28:50.880 --> 00:28:55.600 visible only if the user that is 00:28:54.399 --> 00:28:57.520 currently logged 00:28:55.600 --> 00:29:00.240 has this right you can also use the 00:28:57.520 --> 00:29:02.480 right annotation and feels directly 00:29:00.240 --> 00:29:05.039 you can even do fine-grained 00:29:02.480 --> 00:29:08.080 authorization 00:29:05.039 --> 00:29:10.000 if you want to say that some objects can 00:29:08.080 --> 00:29:13.760 be seen but not others 00:29:10.000 --> 00:29:17.039 in this example i've got an email field 00:29:13.760 --> 00:29:19.919 from a user and basically i am saying 00:29:17.039 --> 00:29:20.240 that i am looking at the component of 00:29:19.919 --> 00:29:23.679 the 00:29:20.240 --> 00:29:26.559 the user of the current user 00:29:23.679 --> 00:29:27.840 and comparing it with the company of the 00:29:26.559 --> 00:29:30.880 user that is logged 00:29:27.840 --> 00:29:32.320 user here refers to the user that is 00:29:30.880 --> 00:29:35.440 currently loaded 00:29:32.320 --> 00:29:37.440 and basically this is saying i can see 00:29:35.440 --> 00:29:39.840 the email of the people that are 00:29:37.440 --> 00:29:41.200 in the same company as me i can see the 00:29:39.840 --> 00:29:43.200 email of my colleagues 00:29:41.200 --> 00:29:44.880 but i cannot see the email of someone 00:29:43.200 --> 00:29:47.840 that is 00:29:44.880 --> 00:29:48.480 not my colleague so with this security 00:29:47.840 --> 00:29:51.039 annotation 00:29:48.480 --> 00:29:53.520 we can have something that is going 00:29:51.039 --> 00:29:56.960 quite deep 00:29:53.520 --> 00:29:59.919 to do fine-grained authorization 00:29:56.960 --> 00:30:01.200 another feature i like a lot is auto 00:29:59.919 --> 00:30:05.120 wiring 00:30:01.200 --> 00:30:08.640 uh basically here we are in a domain 00:30:05.120 --> 00:30:12.159 object a product and uh 00:30:08.640 --> 00:30:12.960 let's admit i want to compute the v80 of 00:30:12.159 --> 00:30:15.039 a product 00:30:12.960 --> 00:30:16.399 computing the v80 of a product can be 00:30:15.039 --> 00:30:20.000 quite complicated 00:30:16.399 --> 00:30:23.039 maybe i need to know uh the type of the 00:30:20.000 --> 00:30:26.960 product the country the 00:30:23.039 --> 00:30:29.840 uh the user is in so it can be difficult 00:30:26.960 --> 00:30:31.440 and we typically won't do it in the 00:30:29.840 --> 00:30:34.399 domain object but rather 00:30:31.440 --> 00:30:36.000 rather we will call a service but you 00:30:34.399 --> 00:30:39.360 when you are in a domain object 00:30:36.000 --> 00:30:42.480 accessing services accessing services is 00:30:39.360 --> 00:30:45.520 difficult and what we can do here is 00:30:42.480 --> 00:30:46.960 auto wire called the auto wire ring and 00:30:45.520 --> 00:30:47.919 basically graphic light will 00:30:46.960 --> 00:30:50.799 automatically 00:30:47.919 --> 00:30:52.480 inject when i'm calling the v80 field it 00:30:50.799 --> 00:30:55.360 will automatically inject 00:30:52.480 --> 00:30:56.080 from the dependency injection container 00:30:55.360 --> 00:30:59.039 the service 00:30:56.080 --> 00:31:01.200 the v80 service and i can use it 00:30:59.039 --> 00:31:05.039 directly in the resolver here 00:31:01.200 --> 00:31:07.360 so it enables me to access services and 00:31:05.039 --> 00:31:08.399 from a domain object by passing those 00:31:07.360 --> 00:31:10.960 services 00:31:08.399 --> 00:31:11.519 in parameters of the resolver which is 00:31:10.960 --> 00:31:15.279 kind of 00:31:11.519 --> 00:31:17.120 kind of cool yeah there are many many 00:31:15.279 --> 00:31:20.240 more features 00:31:17.120 --> 00:31:21.120 available uh we have support for 00:31:20.240 --> 00:31:23.760 validation 00:31:21.120 --> 00:31:24.159 uh for uh indium types even if they 00:31:23.760 --> 00:31:28.240 don't 00:31:24.159 --> 00:31:30.399 exist in php file uploads um 00:31:28.240 --> 00:31:31.760 what i invite you to do if you are 00:31:30.399 --> 00:31:34.880 interested 00:31:31.760 --> 00:31:38.080 in trying out graphqlite is 00:31:34.880 --> 00:31:41.200 having a look at the documentation 00:31:38.080 --> 00:31:44.559 everything is i hope clearly documented 00:31:41.200 --> 00:31:45.120 and if you have any issue well you can 00:31:44.559 --> 00:31:49.039 always 00:31:45.120 --> 00:31:52.480 contact me either on 00:31:49.039 --> 00:31:55.760 twitter directly or if you prefer 00:31:52.480 --> 00:31:58.960 uh just open an issue 00:31:55.760 --> 00:32:02.000 on the graphqlite repository yeah 00:31:58.960 --> 00:32:05.120 so yeah that's repetitive let's wrap uh 00:32:02.000 --> 00:32:08.080 this um this talk uh 00:32:05.120 --> 00:32:09.440 basically uh doing graphql in php is 00:32:08.080 --> 00:32:12.559 definitely possible 00:32:09.440 --> 00:32:13.200 you have many possibilities out there uh 00:32:12.559 --> 00:32:16.640 and this is 00:32:13.200 --> 00:32:19.919 since graphql is pretty cool uh 00:32:16.640 --> 00:32:20.960 well i definitely invite you to to try 00:32:19.919 --> 00:32:24.080 it out 00:32:20.960 --> 00:32:26.480 and uh that's it do you have any 00:32:24.080 --> 00:32:26.480 questions 00:32:27.120 --> 00:32:30.320 thanks so much david it was such 00:32:29.039 --> 00:32:32.640 incredible talk 00:32:30.320 --> 00:32:35.519 i really enjoyed it all the life current 00:32:32.640 --> 00:32:35.519 day we were scared 00:32:35.760 --> 00:32:39.440 yeah everything was incredible so that's 00:32:37.600 --> 00:32:43.039 great uh so yeah 00:32:39.440 --> 00:32:46.240 do yeah we have a question yes 00:32:43.039 --> 00:32:49.519 uh so florian he's asking about 00:32:46.240 --> 00:32:52.559 if graph graphic graph live 00:32:49.519 --> 00:32:55.440 is is gonna support or is currently 00:32:52.559 --> 00:32:57.200 supporting subscriptions 00:32:55.440 --> 00:32:59.919 it is not currently supporting 00:32:57.200 --> 00:33:03.440 subscriptions 00:32:59.919 --> 00:33:06.960 i plan to add support for subscriptions 00:33:03.440 --> 00:33:09.760 in the future maybe 00:33:06.960 --> 00:33:10.880 not in the in the two coming months 00:33:09.760 --> 00:33:14.480 because i want to 00:33:10.880 --> 00:33:16.880 to release a version 4.1 of graphqlite 00:33:14.480 --> 00:33:18.080 and i'm no subscriptions won't be part 00:33:16.880 --> 00:33:22.559 of this release 00:33:18.080 --> 00:33:24.799 but yes i would like to to work on that 00:33:22.559 --> 00:33:26.159 for the end of the year definitely 00:33:24.799 --> 00:33:28.159 definitely well that 00:33:26.159 --> 00:33:29.360 that's that sounds super exciting i 00:33:28.159 --> 00:33:31.679 guess and 00:33:29.360 --> 00:33:32.720 i think i have another question because 00:33:31.679 --> 00:33:35.360 i found 00:33:32.720 --> 00:33:36.559 out super super interesting so i'd like 00:33:35.360 --> 00:33:39.919 to understand like 00:33:36.559 --> 00:33:43.600 like why do you why did you decide to 00:33:39.919 --> 00:33:45.600 go and build this incredible technology 00:33:43.600 --> 00:33:48.399 and what are kind of like the future 00:33:45.600 --> 00:33:52.000 plans for for it 00:33:48.399 --> 00:33:54.559 oh okay uh um 00:33:52.000 --> 00:33:56.080 well when i started uh writing 00:33:54.559 --> 00:34:00.000 graphically light it was 00:33:56.080 --> 00:34:02.640 two years ago and basically you had only 00:34:00.000 --> 00:34:04.559 two options at the time it was using 00:34:02.640 --> 00:34:06.480 webonix directly 00:34:04.559 --> 00:34:08.720 or uh using um 00:34:06.480 --> 00:34:10.879 [Music] 00:34:08.720 --> 00:34:12.320 using ushido which is a library that has 00:34:10.879 --> 00:34:14.159 been abandoned 00:34:12.320 --> 00:34:18.000 and basically they were really low level 00:34:14.159 --> 00:34:18.000 libraries and they were hard to use 00:34:18.079 --> 00:34:21.919 and i have this huge project for a 00:34:20.480 --> 00:34:24.079 client of mine 00:34:21.919 --> 00:34:27.119 uh we are just at the coding machine we 00:34:24.079 --> 00:34:30.800 are doing mostly internet and extranet 00:34:27.119 --> 00:34:35.200 applications and a client of mine 00:34:30.800 --> 00:34:37.200 uh had uh this huge rest api 00:34:35.200 --> 00:34:38.879 with a lot of end points and maybe read 00:34:37.200 --> 00:34:41.760 on the end points 00:34:38.879 --> 00:34:42.240 i wanted to do graphql because i knew 00:34:41.760 --> 00:34:44.560 that 00:34:42.240 --> 00:34:46.240 the flexibility of graph create would be 00:34:44.560 --> 00:34:49.440 really really beneficial 00:34:46.240 --> 00:34:50.960 for that client and uh the only option i 00:34:49.440 --> 00:34:55.200 had was webonix which was 00:34:50.960 --> 00:34:57.599 too hard to use uh and so i decided 00:34:55.200 --> 00:35:00.880 i started writing a small library which 00:34:57.599 --> 00:35:04.240 became a bit more complex 00:35:00.880 --> 00:35:05.599 and uh i did two three versions of the 00:35:04.240 --> 00:35:09.200 library and then i 00:35:05.599 --> 00:35:09.440 i told myself okay uh i i must work on 00:35:09.200 --> 00:35:12.560 it 00:35:09.440 --> 00:35:14.640 really seriously put it on um 00:35:12.560 --> 00:35:15.760 open source it and well that's how 00:35:14.640 --> 00:35:19.040 graphic light 00:35:15.760 --> 00:35:19.599 was born actually well that sounds that 00:35:19.040 --> 00:35:22.000 sounds 00:35:19.599 --> 00:35:22.720 so great and i think like thanks so much 00:35:22.000 --> 00:35:24.400 for 00:35:22.720 --> 00:35:26.400 contributing with the graphql community 00:35:24.400 --> 00:35:27.839 in this case in the php because 00:35:26.400 --> 00:35:30.000 yeah i think there are not so many 00:35:27.839 --> 00:35:33.200 people that either they don't know that 00:35:30.000 --> 00:35:34.880 they are able to do these or they 00:35:33.200 --> 00:35:36.320 figure out they like realize that it's a 00:35:34.880 --> 00:35:38.480 bit more difficult so it's even like a 00:35:36.320 --> 00:35:42.160 start you know like to contribute so 00:35:38.480 --> 00:35:44.560 i i i think like like like this is super 00:35:42.160 --> 00:35:46.800 super super interested and i think like 00:35:44.560 --> 00:35:48.240 a if the people they do know this 00:35:46.800 --> 00:35:48.560 library they are going to start to use 00:35:48.240 --> 00:35:50.000 it 00:35:48.560 --> 00:35:52.079 they are going to like it and they are 00:35:50.000 --> 00:35:54.320 going to like adopting their company so 00:35:52.079 --> 00:35:55.839 um yeah thanks so much for sharing this 00:35:54.320 --> 00:35:58.640 knowledge with us 00:35:55.839 --> 00:35:58.640 you're welcome yeah 00:35:58.960 --> 00:36:02.320 yeah thanks so much for like like like 00:36:00.960 --> 00:36:04.400 like contacting us to 00:36:02.320 --> 00:36:05.440 speak uh because it's it's been 00:36:04.400 --> 00:36:06.880 difficult to find 00:36:05.440 --> 00:36:08.320 kind of like people that they have 00:36:06.880 --> 00:36:09.760 companies in hong kong although you are 00:36:08.320 --> 00:36:11.280 not in hong kong right now but i 00:36:09.760 --> 00:36:12.800 you're like really connected to the hong 00:36:11.280 --> 00:36:15.760 kong community so 00:36:12.800 --> 00:36:16.720 i am so so glad to have you here and 00:36:15.760 --> 00:36:20.000 thanks so much and 00:36:16.720 --> 00:36:23.440 i really really hope to see you soon 00:36:20.000 --> 00:36:27.200 thank you very much okay david thanks 00:36:23.440 --> 00:36:27.200 so up next so