Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/axtiva/flexible-graphql-federation

Schema SDL first lib for generate php code from graphql sdl to TypeRegistry with webonyx/graphql-php for apollo federation properties
https://github.com/axtiva/flexible-graphql-federation

Last synced: about 2 months ago
JSON representation

Schema SDL first lib for generate php code from graphql sdl to TypeRegistry with webonyx/graphql-php for apollo federation properties

Awesome Lists containing this project

README

        

# flexible-graphql-federation

Extension for [axtiva/flexible-graphql-php](https://github.com/axtiva/flexible-graphql-php) for support [Apollo Federation](https://www.apollographql.com/docs/federation/)
in php implementation as SDL first code generation.

# Install

```
composer require axtiva/flexible-graphql-federation
```

## Integration into [axtiva/flexible-graphql-php](https://github.com/axtiva/flexible-graphql-php)

```php
addFieldResolverGenerator(new _EntitiesResolverGenerator($fieldResolverConfig));
$builder->addFieldResolverGenerator(new _ServiceResolverGenerator($fieldResolverConfig));
$builder->addModelGenerator(new FederationRepresentationResolverGenerator($representationConfig));

$generator = $builder->build();

$schema = FederationSchemaExtender::build(SchemaBuilder::build('/path/to/schema.graphql'));

foreach ($generator->generateAllTypes($schema) as $filename);
```