Skip to content

Commit 942b9af

Browse files
authored
Updated docs for namespaces that are incompatible with the new class-finder lib (#680)
1 parent 657790b commit 942b9af

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

website/docs/other-frameworks.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ use TheCodingMachine\GraphQLite\SchemaFactory;
3838
// $cache is a PSR-16 compatible cache
3939
// $container is a PSR-11 compatible container
4040
$factory = new SchemaFactory($cache, $container);
41-
$factory->addControllerNamespace('App\\Controllers\\')
42-
->addTypeNamespace('App\\');
41+
$factory->addControllerNamespace('App\\Controllers')
42+
->addTypeNamespace('App');
4343

4444
$schema = $factory->createSchema();
4545
```
@@ -109,8 +109,8 @@ use Kcs\ClassFinder\Finder\ComposerFinder;
109109
use TheCodingMachine\GraphQLite\SchemaFactory;
110110

111111
$factory = new SchemaFactory($cache, $container);
112-
$factory->addControllerNamespace('App\\Controllers\\')
113-
->addTypeNamespace('App\\')
112+
$factory->addControllerNamespace('App\\Controllers')
113+
->addTypeNamespace('App')
114114
->setFinder(
115115
(new ComposerFinder())->useAutoloading(false)
116116
);
@@ -132,8 +132,8 @@ use TheCodingMachine\GraphQLite\Context\Context;
132132
// $cache is a PSR-16 compatible cache.
133133
// $container is a PSR-11 compatible container.
134134
$factory = new SchemaFactory($cache, $container);
135-
$factory->addControllerNamespace('App\\Controllers\\')
136-
->addTypeNamespace('App\\');
135+
$factory->addControllerNamespace('App\\Controllers')
136+
->addTypeNamespace('App');
137137

138138
$schema = $factory->createSchema();
139139

@@ -290,8 +290,8 @@ return new Picotainer([
290290
Schema::class => function(ContainerInterface $container) {
291291
// The magic happens here. We create a schema using GraphQLite SchemaFactory.
292292
$factory = new SchemaFactory($container->get(CacheInterface::class), $container);
293-
$factory->addControllerNamespace('App\\Controllers\\');
294-
$factory->addTypeNamespace('App\\');
293+
$factory->addControllerNamespace('App\\Controllers');
294+
$factory->addTypeNamespace('App');
295295
return $factory->createSchema();
296296
}
297297
]);

website/versioned_docs/version-7.0.0/other-frameworks.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ use TheCodingMachine\GraphQLite\SchemaFactory;
3838
// $cache is a PSR-16 compatible cache
3939
// $container is a PSR-11 compatible container
4040
$factory = new SchemaFactory($cache, $container);
41-
$factory->addControllerNamespace('App\\Controllers\\')
42-
->addTypeNamespace('App\\');
41+
$factory->addControllerNamespace('App\\Controllers')
42+
->addTypeNamespace('App');
4343

4444
$schema = $factory->createSchema();
4545
```
@@ -112,8 +112,8 @@ use TheCodingMachine\GraphQLite\Context\Context;
112112
// $cache is a PSR-16 compatible cache.
113113
// $container is a PSR-11 compatible container.
114114
$factory = new SchemaFactory($cache, $container);
115-
$factory->addControllerNamespace('App\\Controllers\\')
116-
->addTypeNamespace('App\\');
115+
$factory->addControllerNamespace('App\\Controllers')
116+
->addTypeNamespace('App');
117117

118118
$schema = $factory->createSchema();
119119

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

0 commit comments

Comments
 (0)