- 
                Notifications
    
You must be signed in to change notification settings  - Fork 61
 
WIP: GraphQL 4 #266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Merged
      
      
            chillu
  merged 107 commits into
  silverstripe:master
from
unclecheese:pulls/master/schemageddon
  
      
      
   
  Oct 7, 2020 
      
    
  
     Merged
                    WIP: GraphQL 4 #266
Changes from all commits
      Commits
    
    
            Show all changes
          
          
            107 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      98646b7
              
                First pass, code gen working
              
              
                 691cc5f
              
                Resolver registry, enums
              
              
                 09f39d0
              
                Testing query resolver
              
              
                 323bf71
              
                Fix framework version constraint
              
              
                 914e036
              
                We're reading dataobjects
              
              
                 a50fa56
              
                We have CRUD
              
              
                 16eb6ca
              
                Custom properties, nested types and more
              
              
                 814e0ab
              
                Inheritance chains working
              
              
                 b64ce75
              
                Massive namespacing refactor
              
              
                 7fd63a1
              
                Add procedural API, lazy definitions
              
              
                 af6ed74
              
                Procedural API improvements
              
              
                 936b1ef
              
                Pagination is working
              
              
                 93f2be1
              
                query filter type created
              
              
                 d41443e
              
                Query filter
              
              
                 d0267dd
              
                Inheritance chain is back as a plugin
              
              
                 a4173b1
              
                Abstract QueryFilter so it's not just for dataobjects
              
              
                 51cb64e
              
                Refactor to use inheritance for nested filter input
              
              
                 e851184
              
                Benchmark testing, preparing for test launch
              
              
                 b4efabc
              
                Interfaces, unions, all kinds of stuff for assets and version compat
              
              
                 6a182f4
              
                Add querperf and schemaperf headers
              
              
                 3a7e0bd
              
                Fix readone
              
              
                 abe9aae
              
                Annotations, dead code removal
              
              
                 b83958f
              
                Re-run same benchmarks
              
              
                chillu f7ec08e
              
                Schema persister dependancy
              
              
                senorgeno 552912d
              
                Split types into separate files. Mega speed boost
              
              
                 35e9776
              
                Incremental builds. 🚀
              
              
                 e7209cf
              
                Proper output handling
              
              
                 7b76a39
              
                Fix cache pollution
              
              
                 938efbc
              
                Temporary die to check controller perf
              
              
                 5cda34f
              
                Remove dev.yml
              
              
                 df55070
              
                Replace middlewares
              
              
                 d5adb0a
              
                Fix invalid code for unions, interfaces
              
              
                 135426a
              
                Clean up old tests, simplify code gen storage
              
              
                 b1f50c6
              
                md5 signatures
              
              
                 3669acf
              
                Fix incomplete field signature on types
              
              
                 e6af49f
              
                New simplified constructor for Controller
              
              
                 5b12640
              
                Define schema docs
              
              
                 ed3d0bb
              
                Docs updates
              
              
                 6c760fb
              
                Doc doc doc docking
              
              
                 65d67e9
              
                Doc reorganising for doc site
              
              
                 dc46267
              
                Docky docky docky
              
              
                 e6d8b31
              
                Start on upgrade docs
              
              
                 2c7a6db
              
                Upgrading docs done
              
              
                 c33d329
              
                Plugin docs
              
              
                 331fa7c
              
                DOCS: Add new graphql 4 docs
              
              
                 04d3434
              
                Revisions per max
              
              
                 bda5070
              
                Update src/Schema/Interfaces/ResolverProvider.php
              
              
                 6c74dad
              
                Fix pass by reference error
              
              
                 e7cb1ea
              
                Update docs/en/01_getting_started/04_working_with_dataobjects/07_nest…
              
              
                 e301dbf
              
                Update src/Schema/Schema.php
              
              
                 f6931bb
              
                Update src/Schema/Schema.php
              
              
                 6e673fe
              
                Update src/Controller.php
              
              
                 fe6d5ff
              
                Update src/Controller.php
              
              
                 470217e
              
                Update src/Middleware/CSRFMiddleware.php
              
              
                 278a51c
              
                Update src/QueryHandler/QueryHandler.php
              
              
                 c6ecb9d
              
                Update src/QueryHandler/QueryHandler.php
              
              
                 221361f
              
                Update src/QueryHandler/QueryHandler.php
              
              
                 2f5d8cb
              
                Update src/QueryHandler/QueryHandler.php
              
              
                 0f9eb8c
              
                Update src/Schema/DataObject/FieldAccessor.php
              
              
                 6841480
              
                Update src/Schema/DataObject/CreateCreator.php
              
              
                 cae3cbe
              
                Remove docs
              
              
                 9e51197
              
                Move query filter to DataObject
              
              
                 6e2ae09
              
                Remove custom logger
              
              
                 942d866
              
                Update src/Schema/DataObject/Plugin/Paginator.php
              
              
                 0caa7d1
              
                Update src/Schema/DataObject/Plugin/QuerySort.php
              
              
                 7882d67
              
                Update src/Schema/DataObject/Resolver.php
              
              
                 e4c01cd
              
                Update src/Schema/Interfaces/OperationCreator.php
              
              
                 f01b298
              
                Code storage optimisations, simplify encodedType API, add ModelFieldP…
              
              
                 5a2a0b6
              
                Fix pagination resolver
              
              
                 78006a5
              
                Monolithic canView plugin
              
              
                 c07f819
              
                Make fieldResolver authoratative, fix __extend
              
              
                 0e26886
              
                Heaps of hackday fixes
              
              
                 8118324
              
                Flushless yaml
              
              
                 7b85edd
              
                Flushless tidy up
              
              
                 b2a258b
              
                Allow global flushless schema
              
              
                 f0fd9b9
              
                Uppercase typenames
              
              
                 c9ae855
              
                Remove ViewableData, use standard PHP templating, improve builds 50%
              
              
                 c3136fb
              
                Update src/Schema/Schema.php
              
              
                 c1642c2
              
                Update src/Schema/DataObject/Plugin/QueryFilter/Filters/InFilter.php
              
              
                 1f3e1c0
              
                Nested queries pluggable
              
              
                 5caa4e7
              
                Nested query tidy up, template tidy up
              
              
                 dcca6f3
              
                Remove useless class
              
              
                 c4951e1
              
                Revert readOne change
              
              
                 acbd2ab
              
                Add hasPlugin, new done() function for resolver chain interruption
              
              
                 36095e0
              
                ReadOne now works just like read, only with firstResult plugin applied
              
              
                 cedacb7
              
                Experimental query caching
              
              
                 b99606d
              
                Heaps of fixes for elemental compat
              
              
                 80cf697
              
                BUGFIX: Default plugins should not override custom
              
              
                 c163c97
              
                Remove nested operations
              
              
                 2350996
              
                NEW: dev/graphql admin
              
              
                 b2f5830
              
                Configure operation names
              
              
                 62f0492
              
                NEW schema defaults
              
              
                 ce62cd3
              
                Inherited plugins
              
              
                 b42e3f9
              
                NEW atomic schema build
              
              
                 78d11e8
              
                NEW exclude, customise ALL
              
              
                 deb36aa
              
                Include whitelist of fields for input tyep
              
              
                 6a97f7b
              
                NEW: Major revisions to __extends
              
              
                 3844ab4
              
                Change global config precedence
              
              
                 d6fdb42
              
                Fix precedence of flushable config
              
              
                 d2f3bf5
              
                More revisions to _extends union to show only explicitly exposed nati…
              
              
                 ab43420
              
                Per-model configuation, restore nested_query_plugins
              
              
                 232a85e
              
                Ensure types inherit parent fields
              
              
                 8a2d2f0
              
                New dev/build extension
              
              
                 d76a697
              
                Plugin validation improvements
              
              
                 60a1060
              
                Fix cache pollution in multi schema builds
              
              
                 11642b0
              
                Heaps of fixes for elemental compat
              
              
                 a1865ce
              
                More revisions to type-mapping persistence
              
              
                 File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
      
      Oops, something went wrong.
      
    
  
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| --- | ||
| Name: silverstripe-graphql-dataobject | ||
| --- | ||
| SilverStripe\GraphQL\Schema\DataObject\DataObjectModel: | ||
| operations: | ||
| read: 'SilverStripe\GraphQL\Schema\DataObject\ReadCreator' | ||
| readOne: 'SilverStripe\GraphQL\Schema\DataObject\ReadOneCreator' | ||
| delete: 'SilverStripe\GraphQL\Schema\DataObject\DeleteCreator' | ||
| update: 'SilverStripe\GraphQL\Schema\DataObject\UpdateCreator' | ||
| create: 'SilverStripe\GraphQL\Schema\DataObject\CreateCreator' | ||
| SilverStripe\ORM\DataObject: | ||
| graphql_blacklisted_fields: | ||
| ClassName: true | ||
| LinkTracking: true | ||
| FileTracking: true | ||
| extensions: | ||
| - SilverStripe\GraphQL\Extensions\DevBuildExtension | ||
| 
     | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| --- | ||
| Name: graphql-dbtypes | ||
| --- | ||
| # Assign each DBField subclass with an associated internal type | ||
| SilverStripe\ORM\FieldType\DBField: | ||
| graphql_type: String | ||
| SilverStripe\ORM\FieldType\DBInt: | ||
| graphql_type: Int | ||
| SilverStripe\ORM\FieldType\DBBoolean: | ||
| graphql_type: Boolean | ||
| SilverStripe\ORM\FieldType\DBFloat: | ||
| graphql_type: Float | ||
| SilverStripe\ORM\FieldType\DBDecimal: | ||
| graphql_type: Float | ||
| SilverStripe\ORM\FieldType\DBPrimaryKey: | ||
| graphql_type: ID | ||
| SilverStripe\ORM\FieldType\DBForeignKey: | ||
| graphql_type: ID | ||
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| --- | ||
| Name: 'graphql-default-schema' | ||
| --- | ||
| SilverStripe\Core\Injector\Injector: | ||
| # Set up a default endpoint that can be activated with a Director rule | ||
| SilverStripe\GraphQL\Controller.default: | ||
| class: SilverStripe\GraphQL\Controller | ||
| constructor: | ||
| schema: default | ||
| # use a custom handler so it's easy to override/add middlewares in the default schema | ||
| handler: '%$SilverStripe\GraphQL\QueryHandler\QueryHandlerInterface.default' | ||
| 
     | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -1,10 +1,13 @@ | ||
| --- | ||
| Name: graphqltest | ||
| Before: | ||
| - '#sapphiretest' | ||
| Name: graphql-dev | ||
| --- | ||
| SilverStripe\Core\Injector\Injector: | ||
| SilverStripe\Dev\State\SapphireTestState: | ||
| properties: | ||
| States: | ||
| disabletypecaching: '%$SilverStripe\GraphQL\Dev\State\DisableTypeCacheState' | ||
| SilverStripe\Dev\DevelopmentAdmin: | ||
| registered_controllers: | ||
| graphql: | ||
| controller: SilverStripe\GraphQL\Dev\DevelopmentAdmin | ||
| links: | ||
| build: 'Build/rebuild the GraphQL schema' | ||
| SilverStripe\GraphQL\Dev\DevelopmentAdmin: | ||
| registered_controllers: | ||
| build: | ||
| controller: SilverStripe\GraphQL\Dev\Build | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| --- | ||
| Name: 'graphql-middlewares' | ||
| --- | ||
| SilverStripe\Core\Injector\Injector: | ||
| # default implementation | ||
| SilverStripe\GraphQL\QueryHandler\QueryHandlerInterface: | ||
| class: SilverStripe\GraphQL\QueryHandler\QueryHandler | ||
| properties: | ||
| Middlewares: | ||
| csrf: '%$SilverStripe\GraphQL\Middleware\CSRFMiddleware' | ||
| httpMethod: '%$SilverStripe\GraphQL\Middleware\HTTPMethodMiddleware' | ||
| 
     | 
||
| # duplicate implementation do that the default schema has its own instance to | ||
| # configure without affecting other schemas | ||
| SilverStripe\GraphQL\QueryHandler\QueryHandlerInterface.default: | ||
| class: SilverStripe\GraphQL\QueryHandler\QueryHandler | ||
| properties: | ||
| Middlewares: | ||
| csrf: '%$SilverStripe\GraphQL\Middleware\CSRFMiddleware' | ||
| httpMethod: '%$SilverStripe\GraphQL\Middleware\HTTPMethodMiddleware' | ||
| 
     | 
||
| Psr\SimpleCache\CacheInterface.graphql: | ||
| factory: SilverStripe\Core\Cache\CacheFactory | ||
| constructor: | ||
| namespace: "graphql" | ||
| defaultLifetime: 600 | ||
| 
     | 
||
| SilverStripe\GraphQL\Middleware\QueryCachingMiddleware: | ||
| properties: | ||
| Cache: '%$Psr\SimpleCache\CacheInterface.graphql' | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| --- | ||
| Name: silverstripe-graphql-model | ||
| --- | ||
| SilverStripe\Core\Injector\Injector: | ||
| SilverStripe\GraphQL\Schema\Registry\SchemaModelCreatorRegistry: | ||
| constructor: | ||
| dataobject: '%$SilverStripe\GraphQL\Schema\DataObject\ModelCreator' | ||
| SilverStripe\GraphQL\Schema\Schema: | ||
| schemas: | ||
| '*': | ||
| modelConfig: | ||
| DataObject: | ||
| type_formatter: [ 'SilverStripe\Core\ClassInfo', 'shortName' ] | ||
| type_prefix: '' | ||
| type_mapping: [] | ||
| nested_query_plugins: [] | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| --- | ||
| Name: graphql-plugins | ||
| --- | ||
| SilverStripe\Core\Injector\Injector: | ||
| SilverStripe\GraphQL\Schema\Registry\PluginRegistry: | ||
| constructor: | ||
| paginator: '%$SilverStripe\GraphQL\Schema\Plugin\PaginationPlugin' | ||
| dataobjectPaginator: '%$SilverStripe\GraphQL\Schema\DataObject\Plugin\Paginator' | ||
| dataobjectQueryFilter: '%$SilverStripe\GraphQL\Schema\DataObject\Plugin\QueryFilter\QueryFilter' | ||
| dataobjectQuerySort: '%$SilverStripe\GraphQL\Schema\DataObject\Plugin\QuerySort' | ||
| dataobjectInheritance: '%$SilverStripe\GraphQL\Schema\DataObject\Plugin\Inheritance' | ||
| canViewPermission: '%$SilverStripe\GraphQL\Schema\DataObject\Plugin\CanViewPermission' | ||
| firstResult: '%$SilverStripe\GraphQL\Schema\DataObject\Plugin\FirstResult' | ||
| inheritedPlugins: '%$SilverStripe\GraphQL\Schema\DataObject\Plugin\InheritedPlugins' | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| This folder contains a "pseudo-module" for SilverStripe | ||
| with some runnable code examples. In order to try them out yourself, | ||
| move the `examples` folder to the top level of your SilverStripe | ||
| project and remove the `_manifest_exclude` file. | ||
| ## COMING SOON ## | ||
| 
     | 
||
| The v4 release of this module does not yet have any example code. | 
This file was deleted.
      
      Oops, something went wrong.
      
    
  
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.