Skip to content

Commit

Permalink
Updated docs for namespaces that are incompatible with the new class-…
Browse files Browse the repository at this point in the history
…finder lib
  • Loading branch information
oojacoboo committed Apr 12, 2024
1 parent 657790b commit 8447758
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
16 changes: 8 additions & 8 deletions website/docs/other-frameworks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ use TheCodingMachine\GraphQLite\SchemaFactory;
// $cache is a PSR-16 compatible cache
// $container is a PSR-11 compatible container
$factory = new SchemaFactory($cache, $container);
$factory->addControllerNamespace('App\\Controllers\\')
->addTypeNamespace('App\\');
$factory->addControllerNamespace('App\\Controllers')
->addTypeNamespace('App');

$schema = $factory->createSchema();
```
Expand Down Expand Up @@ -109,8 +109,8 @@ use Kcs\ClassFinder\Finder\ComposerFinder;
use TheCodingMachine\GraphQLite\SchemaFactory;

$factory = new SchemaFactory($cache, $container);
$factory->addControllerNamespace('App\\Controllers\\')
->addTypeNamespace('App\\')
$factory->addControllerNamespace('App\\Controllers')
->addTypeNamespace('App')
->setFinder(
(new ComposerFinder())->useAutoloading(false)
);
Expand All @@ -132,8 +132,8 @@ use TheCodingMachine\GraphQLite\Context\Context;
// $cache is a PSR-16 compatible cache.
// $container is a PSR-11 compatible container.
$factory = new SchemaFactory($cache, $container);
$factory->addControllerNamespace('App\\Controllers\\')
->addTypeNamespace('App\\');
$factory->addControllerNamespace('App\\Controllers')
->addTypeNamespace('App');

$schema = $factory->createSchema();

Expand Down Expand Up @@ -290,8 +290,8 @@ return new Picotainer([
Schema::class => function(ContainerInterface $container) {
// The magic happens here. We create a schema using GraphQLite SchemaFactory.
$factory = new SchemaFactory($container->get(CacheInterface::class), $container);
$factory->addControllerNamespace('App\\Controllers\\');
$factory->addTypeNamespace('App\\');
$factory->addControllerNamespace('App\\Controllers');
$factory->addTypeNamespace('App');
return $factory->createSchema();
}
]);
Expand Down
12 changes: 6 additions & 6 deletions website/versioned_docs/version-7.0.0/other-frameworks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ use TheCodingMachine\GraphQLite\SchemaFactory;
// $cache is a PSR-16 compatible cache
// $container is a PSR-11 compatible container
$factory = new SchemaFactory($cache, $container);
$factory->addControllerNamespace('App\\Controllers\\')
->addTypeNamespace('App\\');
$factory->addControllerNamespace('App\\Controllers')
->addTypeNamespace('App');

$schema = $factory->createSchema();
```
Expand Down Expand Up @@ -112,8 +112,8 @@ use TheCodingMachine\GraphQLite\Context\Context;
// $cache is a PSR-16 compatible cache.
// $container is a PSR-11 compatible container.
$factory = new SchemaFactory($cache, $container);
$factory->addControllerNamespace('App\\Controllers\\')
->addTypeNamespace('App\\');
$factory->addControllerNamespace('App\\Controllers')
->addTypeNamespace('App');

$schema = $factory->createSchema();

Expand Down Expand Up @@ -266,8 +266,8 @@ return new Picotainer([
Schema::class => function(ContainerInterface $container) {
// The magic happens here. We create a schema using GraphQLite SchemaFactory.
$factory = new SchemaFactory($container->get(CacheInterface::class), $container);
$factory->addControllerNamespace('App\\Controllers\\');
$factory->addTypeNamespace('App\\');
$factory->addControllerNamespace('App\\Controllers');
$factory->addTypeNamespace('App');
return $factory->createSchema();
}
]);
Expand Down

0 comments on commit 8447758

Please sign in to comment.