1.7.15 • Published 3 years ago

qili-app v1.7.15

Weekly downloads
22
License
MIT
Repository
github
Last release
3 years ago

qili-app

qili-app can help you create graphql client application with qili server as backend at http://app.qili2.com

install

npm install qili-app

##qili-cli qili-cli can help to quick setup a QiliApp

npm install qili-cli -g
cd <project dir>
qili init
npm install
npm dev

features

  • graphql
  • persisted query
  • react-relay
  • hybrid app and web page
  • authentication and authorization out-of-box ready
  • offline supported
  • cloud code

API

State

  • DOMAIN
  • ACTION
  • REDUCER

Components

  • QiliApp: auto handle network/authentication/AD/splash/tutorial/...
  • OfflineUI
  • Offline
  • Comment
  • Empty
  • Setting
  • Profile
  • My
  • File
  • Photo
  • CheckUpdate
  • Account
  • InfoForm
  • wechat

Graphql Hoc Components

  • withQuery(props=>({query:graphql...}))
  • withFragment(props=>({fragment:graphql...}))
  • withPagination(props=>({query:graphql..., fragment: graphql...}))
  • withMutation(props=>({mutation:graphqql...}))
  • withInit(props=>({query:graphql..., onSuccess, onError}))

Cloud API

  • merge: tool to merge resolvers
  • static: to make app support web page
  • wechat: to make wechat api
  • buildPagination for type
  • buildComment for type
  • isDev: to support graphql id only or graphql
  • typeDefs
  • resolver
  • persistedQuery to make server support graphql id for security and performance
  • makeSchema: only for client offline

License

MIT

Example

  • hello world
import React from "react"
import {QiliApp} from 'qili-app'

QiliApp.render(
	<QiliApp appId="xxxx">
		Hello world
	</QiliApp>
)
  • More formal application with initialization when user login/signup
	import React from "react"
	import {QiliApp, withInit} from 'qili-app'
	import {compose, withProps} from "recompose"
	import {Router, hashHistory, IndexRoute} from "react-router"
	const MyApp=compose(
		withProps(()=>({
			project: require("../package.json"),
			appId:"xxx"
		})),
		withInit({
			query:graphql`
				query src_prefetch_Query{
					me{
						id
						token
						book{
							id
							name
							photo
						}
					}
				}
			`,
			onSuccess(response,dispatch){
				
			},
			onError(error,dispatch){
				
			}
		}),
	)(QiliApp)

	QiliApp.render(
		<MyApp>
			<Router history={hashHistory}>
				<IndexRoute component={()=><div>hello</div>}/>
			</Router>
		</MyApp>
	)
1.7.15

3 years ago

1.7.14

4 years ago

1.7.13

4 years ago

1.7.12

4 years ago

1.7.11

4 years ago

1.7.10

4 years ago

1.7.9

4 years ago

1.7.8

4 years ago

1.7.7

4 years ago

1.7.6

5 years ago

1.7.5

5 years ago

1.7.4

5 years ago

1.7.3

5 years ago

1.7.2

5 years ago

1.7.1

5 years ago

1.7.0

5 years ago

1.6.4

5 years ago

1.6.3

5 years ago

1.6.2

5 years ago

1.6.1

5 years ago

1.6.0

5 years ago

1.5.0

5 years ago

1.4.0

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.49

6 years ago

1.2.48

6 years ago

1.2.47

6 years ago

1.2.46

6 years ago

1.2.45

6 years ago

1.2.44

6 years ago

1.2.43

6 years ago

1.2.42

6 years ago

1.2.41

6 years ago

1.2.40

6 years ago

1.2.31

6 years ago

1.2.30

6 years ago

1.2.29

6 years ago

1.2.27

7 years ago

1.2.26

7 years ago

1.2.25

7 years ago

1.2.24

7 years ago

1.2.23

7 years ago

1.2.22

7 years ago

1.2.19

7 years ago

1.2.18

7 years ago

1.2.17

7 years ago

1.2.15

7 years ago

1.2.14

7 years ago

1.2.13

7 years ago

1.2.12

7 years ago

1.2.11

7 years ago

1.2.10

7 years ago

1.2.9

7 years ago

1.2.8

7 years ago

1.2.7

7 years ago

1.2.6

7 years ago

1.2.5

7 years ago

1.2.4

7 years ago

1.2.3

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

0.3.6

9 years ago

0.3.5

9 years ago

0.3.1

9 years ago

0.3.0

9 years ago

0.2.0

9 years ago