Answer the question
In order to leave comments, you need to log in
Which bundle to choose for GraphQl server?
I want to give entities for the application through GraphQl (just lists of entities with filtering by relationships). There is already a full database (postgres), the business logic is all on Laravel.
I started to study a little, the choice fell on a bunch of graphql-yoga + TypeORM, but I ran into some difficulties.
To begin with, TypeOrm is apparently designed for the fact that the database will be created from its migrations, so when describing entities, you must explicitly set the names of the fields, tables and pivot tables in the database. According to the documentation, I could not figure it out everywhere (now I ran into the ManyToMany relationship). Plus, it is very inconvenient to debug such requests in the console
SELECT DISTINCT "distinctAlias"."Doctor_id" as "ids_Doctor_id" FROM (SELECT "Doctor"."id" AS "Doctor_id", "Doctor"."name" AS "Doctor_name", "Doctor"."img" AS "Doctor_img", "Doctor"."date_start_practice" AS "Doctor_date_start_practice", "Doctor"."rating" AS "Doctor_rating", "Doctor__clinics"."id" AS "Doctor__clinics_id", "Doctor__clinics"."name" AS "Doctor__clinics_name", "Doctor__clinics"."description" AS "Doctor__clinics_description", "Doctor__clinics"."institution" AS "Doctor__clinics_institution", "Doctor__clinics"."phone" AS "Doctor__clinics_phone", "Doctor__clinics"."img" AS "Doctor__clinics_img" FROM "doctors" "Doctor" LEFT JOIN "clinic_doctor" "Doctor_Doctor__clinics" ON "Doctor_Doctor__clinics"."doctorsId"="Doctor"."id" LEFT JOIN "clinics" "Doctor__clinics" ON "Doctor__clinics"."id"="Doctor_Doctor__clinics"."clinicsId" WHERE "Doctor"."id" IN ($1)) "distinctAlias" ORDER BY "Doctor_id" ASC LIMIT 1 -- PARAMETERS: ["31"]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question