Skip to content

Commit 9b57f3e

Browse files
committed
fix readme
1 parent b02c998 commit 9b57f3e

File tree

1 file changed

+14
-17
lines changed

1 file changed

+14
-17
lines changed

README.md

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -79,21 +79,6 @@ GraphQL.js is **isomorphic**. You can use it in both **browser and Node.js**.
7979
var graphql = require('graphql.js')
8080
```
8181

82-
##### Using with `graphql-tag`
83-
84-
`[graphql-tag](https://github.com/apollographql/graphql-tag)` converts GraphQL query strings to AST. You can use `graphql-tag` with GraphQL.js
85-
86-
```js
87-
var gql = require('graphql-tag')
88-
var graphql = require('graphql.js')
89-
90-
// setup...
91-
92-
graph.query(gql`query { name }`)
93-
```
94-
95-
> Using `graphql-tag` will not allow you to use _auto declaration_ and _nested fragments_ syntaxes since these are not valid query syntax for GraphQL but only for this library.
96-
9782
## Connection
9883

9984
Create a simple connection to your GraphQL endpoint.
@@ -469,7 +454,8 @@ fragment username_admin on AdminUser {
469454
}
470455
```
471456

472-
## Using with Vue.js
457+
## Advanced
458+
### Using with Vue.js
473459

474460
Create a `GraphQLProvider.js`.
475461

@@ -520,7 +506,7 @@ methods: {
520506
}
521507
```
522508

523-
## Change POST Method
509+
### Change POST Method
524510

525511
As default, GraphQL.js makes a POST request. But you can change the behavior by setting `asJSON`.
526512

@@ -529,6 +515,17 @@ var graph = graphql("http://localhost:3000/graphql", {
529515
asJSON: true
530516
});
531517
```
518+
### Using with `graphql-tag`
519+
520+
[`graphql-tag`](https://github.com/apollographql/graphql-tag) converts GraphQL query strings to AST. You can use `graphql-tag` with GraphQL.js
521+
522+
```js
523+
graph.query(gql`query { name }`)
524+
```
525+
526+
> Using `graphql-tag` will not allow you to use _auto declaration_ and _nested fragments_ syntaxes since these are not valid query syntax for GraphQL but only for this library.
527+
528+
---
532529

533530
## Todo App Example
534531

0 commit comments

Comments
 (0)