Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shendepu/moqui-graphql
Moqui Addon generating GraphQL api based on definition of entity, service and data document
https://github.com/shendepu/moqui-graphql
graphql graphql-java moqui
Last synced: 25 days ago
JSON representation
Moqui Addon generating GraphQL api based on definition of entity, service and data document
- Host: GitHub
- URL: https://github.com/shendepu/moqui-graphql
- Owner: shendepu
- License: other
- Created: 2016-09-22T08:16:18.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2022-01-15T22:21:25.000Z (almost 3 years ago)
- Last Synced: 2024-05-19T14:32:44.839Z (7 months ago)
- Topics: graphql, graphql-java, moqui
- Language: JavaScript
- Homepage: https://www.market47.cn
- Size: 648 KB
- Stars: 7
- Watchers: 4
- Forks: 12
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-graphql-java - Moqui GraphQL
README
# This is Moqui GraphQL Add-On Component
This [Moqui](https://github.com/moqui/moqui-framework) add-on component adds support of [GraphQL](graphql.org) to Moqui.
The way to use it is just simliar to REST Api in moqui-framework.
- The GraphQL endpoint is `/graphql/v1?query={graphQLQueryString}` or `/graphql/v1?query={graphQLQueryString}&&variables={graphQLVariables}`
- The configuration of GraphQL Schema is *.graphql.xml under service directory of component
- Only one schema is produced. Each *.graphql.xml file is produced as a field of root query or mutation with name of schema.@name
- GraphQL execution strategy is BatchedExecutionStrategy
- entity-fetcher is implemented with EntityBatchedDataFetcherYou may try the [demo](https://github.com/shendepu/moqui-graphql-demo)
## About EntityBatchedDataFetcher
In following cases it combined entity-find (sql query essentially) on same field into one entity-find
- one operation: it turn multiple entity-find.one() into entity-find by adding in condition if there is one relationship key map or by adding a tuple (all relationship key map) or condition
- list operation: when there is no pagination argument or pageInfo in field selection set
In following cases it iterate over environment source to run entity-find, so multiple times entity-find is executed, slow.
- list operation: when there is pagination argument or pageInfo in field selection set. this can't be done combining them since each list need count to calculate pageInfo and impossible to equally get same number result for each source in one entity-find.One special case:
- list operation: when there is no pagination argument or pageInfo, but no relationship key map, a pagination limit is enforced to avoid return all data. Due to there should be just one item in environment source, so iterate over it to execute entity-find is fine for performance.# References
- [Relay Cursor Connection Specification](https://facebook.github.io/relay/graphql/connections.htm)
- [Relay Input Object Mutations Specification](https://facebook.github.io/relay/graphql/mutations.htm)# License
Moqui GraphQL is [CC0-licensed](./LICENSE.md). we also provide an addition [copyright and patent grant](./AUTHORS)