Closed pawel-zawadzki closed 6 years ago
First of all I suggest you cover your schema with unit test. That way you don't have to test it in external tools. With PHPUnit it could look like:
public function testSchemaIsValid(): void
{
$schema = new Schema();
$schema->assertValid();
self::assertTrue(true, 'schema passes validation');
}
Second your code is not enough to reproduce the case. Can you isolate the issue by simplifying as much as possible your models and posting it here, so we have a proper Minimal, Complete, and Verifiable example.
Also what version of the lib are you using ?
Validating schema did help me to solve the problem. It seems like unidirectional ManyToOne associations are not supported (that was the case with Product - ProductType association). Changed it to bidirectional association and docs are generating fine.
seems like unidirectional ManyToOne associations are not supported
This is incorrect, they should be supported. \GraphQLTests\Doctrine\Blog\Model\User::$manager
in our unit tests is an example of unidirectional ManyToOne relation. There may have been something else that was wrong (in the mapping or in the lib). It should be investigated further if you stumble on it again in the future.
I've encountered a problem with automatic documentation generation when using generic filters. Filtering in queries is working fine but I get a following error when trying to fetch docs:
I'm using ChromeiQL (same thing happens in GraphiQL Feen). When I comment out args providing generic filters documentation generates without an error. Since this is happening when using two different clients is seems it may be a backend problem.
Here's my code:
Btw, I'm using Zend Expressive and the entity mapping is very simple (Product with couple of fields and ManyToOne association to Type entity).