File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change
1
+ Schema Cache
2
+ ============
3
+
4
+ Save and lazy load [ GraphQL Schema] ( https://webonyx.github.io/graphql-php/schema-definition/ ) from PSR-16 cache.
5
+
6
+ ![ unit tests] ( https://github.com/x-graphql/schema-cache/actions/workflows/unit_tests.yml/badge.svg )
7
+ [ ![ codecov] ( https://codecov.io/gh/x-graphql/schema-cache/graph/badge.svg?token=c1xCJsFvIs )] ( https://codecov.io/gh/x-graphql/schema-cache )
8
+
9
+
10
+ Getting Started
11
+ ---------------
12
+
13
+ Install this package via [ Composer] ( https://getcomposer.org )
14
+
15
+ ``` shell
16
+ composer require x-graphql/schema-cache symfony/cache
17
+ ```
18
+
19
+ Usages
20
+ ------
21
+
22
+ Create an instance of ` XGraphQL\SchemaCache\SchemaCache ` with PSR-16 to save and load:
23
+
24
+ ``` php
25
+ use Symfony\Component\Cache\Adapter\ArrayAdapter;
26
+ use Symfony\Component\Cache\Psr16Cache;
27
+ use XGraphQL\SchemaCache\SchemaCache;
28
+
29
+ $psr16 = new Psr16Cache(new ArrayAdapter());
30
+ $schemaCache = new SchemaCache($psr16);
31
+
32
+ $schemaCache->save(/* $schema */);
33
+
34
+ /// Lazy to load on another http requests
35
+
36
+ $schemaFromCache = $schemaCache->load();
37
+ ```
38
+ > [ !NOTE]
39
+ > This package not support to decorate type after load schema from cache,
40
+ > you need to add type resolvers before execute schema.
41
+
42
+ Credits
43
+ -------
44
+
45
+ Created by [ Minh Vuong] ( https://github.com/vuongxuongminh )
You can’t perform that action at this time.
0 commit comments