GraphQL: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
Line 99: Line 99:
  https://docs.sencha.com/extjs/6.2.0/classic/Ext.grid.filters.Filters.html
  https://docs.sencha.com/extjs/6.2.0/classic/Ext.grid.filters.Filters.html
  https://docs.sencha.com/extjs/6.2.0/classic/src/Filters.js.html
  https://docs.sencha.com/extjs/6.2.0/classic/src/Filters.js.html
==Handle Lazy Loads==
<source lang="java">
import javax.servlet.Filter;
import org.springframework.context.annotation.Configuration
import org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter;
@Configuration
public class SpringGraqphQLConfig {
    /**
    * Register the {@link OpenEntityManagerInViewFilter} so that the
    * GraphQL-Servlet can handle lazy loads during execution.
    *
    * @return
    */
    @Bean
    public Filter OpenFilter() {
        return new OpenEntityManagerInViewFilter();
    }
}
</source>


==References==
==References==

Revision as of 00:49, 10 June 2020

Schema

type Project {
  name: String
  tagline: String
  contributors: [User]
}

Query

{
  project(name: "GraphQL") {
    tagline
  }
}

Results

{
  "project": {
    "tagline": "A query language for APIs"
  }
}

Scalar

About the types you can assign to fields or to the return values of operations. Graphql Java supports the following types:

String                  Boolean                  Int
Float                   ID                       Long
Short                   Byte                     Float
BigDecimal              BigInteger

Sencha Store

Ext/data/
 ├─ operation/
 │  ├─ Create     [POST  ]
 │  ├─ Destory    [DELETE]
 │  ├─ Operation
 │  ├─ Read       [GET   ]
 │  └─ Update     [PUT   ]
 │
 ├─ proxy/
 │  ├─ Ajax
 │  ├─ Proxy
 │  └─ Rest
 │
 ├─ reader/
 │  ├─ Array
 │  ├─ JSON
 │  ├─ Reader
 │  └─ XML
 │
 ├─ request/
 │  ├─ Ajax
 │  ├─ Base
 │  └─ Form
 │
 │
 ├─ writer/
 │  ├─ Array
 │  ├─ JSON
 │  └─ XML
 │
 │
 

Ext/grid/filters/
 ├─ filter
 └─ Filters
https://docs.sencha.com/extjs/6.2.0/classic/Ext.data.JsonStore.html
https://docs.sencha.com/extjs/6.2.0/classic/src/JsonStore.js.html
https://docs.sencha.com/extjs/6.2.0/classic/Ext.data.proxy.Rest.html
https://docs.sencha.com/extjs/6.2.0/classic/src/Rest.js.html
https://docs.sencha.com/extjs/6.2.0/classic/Ext.data.proxy.Ajax.html
https://docs.sencha.com/extjs/6.2.0/classic/src/Ajax.js-1.html
https://docs.sencha.com/extjs/6.2.0/classic/Ext.toolbar.Paging.html
https://docs.sencha.com/extjs/6.2.0/classic/src/Paging.js.html
https://docs.sencha.com/extjs/6.2.0/classic/Ext.grid.filters.Filters.html
https://docs.sencha.com/extjs/6.2.0/classic/src/Filters.js.html

Handle Lazy Loads

import javax.servlet.Filter;
import org.springframework.context.annotation.Configuration
import org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter;

@Configuration
public class SpringGraqphQLConfig {

    /**
     * Register the {@link OpenEntityManagerInViewFilter} so that the
     * GraphQL-Servlet can handle lazy loads during execution.
     *
     * @return
     */
    @Bean
     public Filter OpenFilter() {
        return new OpenEntityManagerInViewFilter();
    }
}

References