Skip to content

Commit

Permalink
Fixing doc for static type mapper
Browse files Browse the repository at this point in the history
  • Loading branch information
moufmouf committed Jul 3, 2020
1 parent aa7be0a commit cca5f0f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions docs/custom_types.md
Expand Up @@ -89,7 +89,7 @@ services:

### Other frameworks

The easiest way is to use a `StaticTypeMapper`. This class is used to register custom output types.
The easiest way is to use a `StaticTypeMapper`. Use this class to register custom output types.

```php
// Sample code:
Expand All @@ -105,11 +105,10 @@ $staticTypeMapper->setNotMappedTypes([
new MyCustomOutputType()
]);

// Register the static type mapper in your application using the SchemaFactory instance
$schemaFactory->addTypeMapper($staticTypeMapper);
```

The `StaticTypeMapper` instance MUST be registered in your container and linked to a `CompositeTypeMapper`
that will aggregate all the type mappers of the application.

## Registering a custom scalar type (advanced)

If you need to add custom scalar types, first, check the [GraphQLite Misc. Types library](https://github.com/thecodingmachine/graphqlite-misc-types).
Expand Down

0 comments on commit cca5f0f

Please sign in to comment.