Skip to content
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

Static case insensitive property check definitions #8

Open
chillu opened this issue Oct 31, 2016 · 0 comments
Open

Static case insensitive property check definitions #8

chillu opened this issue Oct 31, 2016 · 0 comments

Comments

@chillu
Copy link
Member

chillu commented Oct 31, 2016

**Subtask of silverstripe/silverstripe-asset-admin#316 **

At the moment we have CaseInsensitiveFieldAccessor which infers field existence of ViewableData and allows us to reference a urlSegment property in GraphQL, but read/write from URLSegment in the SS ORM.

This is naturally a bit of magic, but its too opaque by placing it in the field resolution. We should move this to the GraphQL type definition instead. This allows us to make mapping choices more explicit.

Rough API sketch:

use Chillu\GraphQL\DataObjectTypeCreator;
use Chillu\GraphQL\LowercaseNameTransformer;
$type = (new DataObjectTypeCreator('SiteTree'))
  ->addFieldTransformer(new LowercaseNameTransformer())
  ->setFields([
    'ID' => [], // transformer sets ['name' => 'id'] automatically
    'URLSegmentField' => ['name' => 'urlSegmentField'] // manual mapping
  )
  ->toType();

TODO Figure out how to retain mapping for query resolvers

This is also required for the type scaffolding

@chillu chillu modified the milestone: CMS 4.0.0-alpha4 Oct 31, 2016
@sminnee sminnee changed the title Static case insensitive property check definitions Subtask: Static case insensitive property check definitions Nov 25, 2016
@chillu chillu changed the title Subtask: Static case insensitive property check definitions Static case insensitive property check definitions Dec 5, 2016
unclecheese pushed a commit to open-sausages/silverstripe-graphql that referenced this issue Jan 9, 2018
FIX: Remove unnecessary test runs of other modules.
maxime-rainville pushed a commit that referenced this issue Feb 17, 2020
* BUG ensure canView() check is run on items

* Remove unused variable

Co-authored-by: Aaron Carlino <[email protected]>
unclecheese pushed a commit to unclecheese/silverstripe-graphql that referenced this issue Jan 27, 2021
…3/clipboard-to-tears

[CVE-2019-12205] Remove jstree demo, clipboard.swf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants