docs icon indicating copy to clipboard operation
docs copied to clipboard

The distribution: needs a review and TLC

Open Uplink03 opened this issue 5 years ago • 0 comments

In the THE DISTRIBUTION: CREATE POWERFUL APIS WITH EASE pages there are quite a few problems.

Some of them transcend into the api-platform distribution itself, but since I started with the documentation I'm writing everything here.

Version of api-platform: 2.5.7

Getting Started with API Platform: Hypermedia and GraphQL API, Admin and Progressive Web App

Problem 1

Using docker pull makes docker-compose up -d fail to start the client service with this error:

yarn run v1.22.5
error Command "dev:ssl" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I worked around that by removing the pulled quay.io/api-platform/client image and letting docker_compose build it.

Problem 2

Conflicting instructions

  • Bringing your Own Model

    delete the file api/src/Entity/Greeting.php

  • Adding GraphQL Support:

    Try it out by creating a greeting

    Well, there's no Greeting entity at this step because it was deleted earlier.

Problem 3

  • A React Progressive Web App The client generator creates incomplete Form.js files. It doesn't import the Field component, so the compilation fails because it's undefined.

    Failed to compile 'Field' is not defined react/jsx-no-undef

Suggestion 1

Since api-platform is using PHP 7.4 in Docker, type annotations for the entity members could be put in.

Suggestion 2

Add Php Inspections (EA Extended) to your favourite tools.

Testing the API

The unit test doesn't just fail, it explodes.

Uplink03 avatar Nov 21 '20 02:11 Uplink03