mirror of
https://github.com/graphql-python/graphene.git
synced 2024-11-26 11:33:55 +03:00
Improved homepage
This commit is contained in:
parent
e5357ccc84
commit
0f94f2b2ef
|
@ -362,6 +362,12 @@ $title
|
||||||
.docs
|
.docs
|
||||||
@extend $wrapper
|
@extend $wrapper
|
||||||
|
|
||||||
|
.homepage-intro
|
||||||
|
col(1/2)
|
||||||
|
|
||||||
|
.homepage-schema
|
||||||
|
col(1/2)
|
||||||
|
|
||||||
.docs-aside
|
.docs-aside
|
||||||
col(1/4)
|
col(1/4)
|
||||||
margin-top 60px
|
margin-top 60px
|
||||||
|
|
|
@ -10,8 +10,8 @@ Let's build a basic GraphQL schema from scratch.
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
- Python (2.6.5+, 2.7, 3.2, 3.3, 3.4, 3.5, pypy)
|
- Python (2.7, 3.2, 3.3, 3.4, 3.5, pypy)
|
||||||
- Graphene (0.4+)
|
- Graphene (0.10+)
|
||||||
|
|
||||||
|
|
||||||
## Project setup
|
## Project setup
|
||||||
|
|
|
@ -3,8 +3,50 @@ path: /
|
||||||
---
|
---
|
||||||
<div class="starwars-example-wrapper"><a class="starwars-example" href="http://swapi.graphene-python.org/">Check our Django Starwars API example!</a></div>
|
<div class="starwars-example-wrapper"><a class="starwars-example" href="http://swapi.graphene-python.org/">Check our Django Starwars API example!</a></div>
|
||||||
|
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<div class="homepage-intro">
|
||||||
|
|
||||||
## Meet Graphene
|
## Meet Graphene
|
||||||
|
|
||||||
Graphene is a Python library for building GraphQL schemas/types fast and easily.
|
Graphene is a Python library for building *GraphQL* schemas/types fast and easily.
|
||||||
|
|
||||||
**But, what is GraphQL?** A GraphQL query is a string interpreted by a server that returns data in a specified format. We believe *GraphQL* is the next big thing after peanut butter and *REST*.
|
|
||||||
|
* **Easy to use**: Graphene helps you use *GraphQL* in Python easily.
|
||||||
|
* Graphene has **builtin support for Relay**.
|
||||||
|
* Support for **Django**, **SQLAlchemy** and **GAE**: mapping the models automatically to *GraphQL* types.
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="homepage-schema">
|
||||||
|
|
||||||
|
```python
|
||||||
|
import graphene
|
||||||
|
|
||||||
|
class Query(graphene.ObjectType):
|
||||||
|
hello = graphene.String()
|
||||||
|
|
||||||
|
def resolve_hello(self, args, info):
|
||||||
|
return 'world'
|
||||||
|
|
||||||
|
schema = graphene.Schema(query=Query)
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
```python
|
||||||
|
result = schema.execute('{ hello }')
|
||||||
|
```
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
|
||||||
|
#### What is GraphQL?
|
||||||
|
*GraphQL* is a data query language and runtime designed to request and deliver data in a performant way.
|
||||||
|
|
||||||
|
Advantages of using *GraphQL*:
|
||||||
|
* Only **one API endpoint**. One roundtrip for fetch everything you need.
|
||||||
|
* No data overfetching or underfetching.
|
||||||
|
* Autogenerated Graphical UI and docs based in your schema.
|
||||||
|
<div>
|
Loading…
Reference in New Issue
Block a user