1.7.15 • Published 2 years ago

qili-app v1.7.15

Weekly downloads
22
License
MIT
Repository
github
Last release
2 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

2 years ago

1.7.14

3 years ago

1.7.13

3 years ago

1.7.12

3 years ago

1.7.11

3 years ago

1.7.10

3 years ago

1.7.9

3 years ago

1.7.8

3 years ago

1.7.7

3 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

5 years ago

1.2.48

5 years ago

1.2.47

5 years ago

1.2.46

5 years ago

1.2.45

5 years ago

1.2.44

5 years ago

1.2.43

5 years ago

1.2.42

5 years ago

1.2.41

5 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

6 years ago

1.2.26

6 years ago

1.2.25

6 years ago

1.2.24

6 years ago

1.2.23

6 years ago

1.2.22

6 years ago

1.2.19

6 years ago

1.2.18

6 years ago

1.2.17

6 years ago

1.2.15

6 years ago

1.2.14

6 years ago

1.2.13

6 years ago

1.2.12

6 years ago

1.2.11

6 years ago

1.2.10

6 years ago

1.2.9

6 years ago

1.2.8

6 years ago

1.2.7

6 years ago

1.2.6

6 years ago

1.2.5

6 years ago

1.2.4

6 years ago

1.2.3

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

0.3.6

8 years ago

0.3.5

8 years ago

0.3.1

8 years ago

0.3.0

8 years ago

0.2.0

8 years ago