Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove query operation name #292

Merged
merged 1 commit into from Oct 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion blog/2018-10-10-say-hello-to-gridsome/index.md
Expand Up @@ -27,7 +27,7 @@ Here is an example on how to query posts from the GraphQL layer in a page:
</template>

<page-query>
query Blog {
query {
allWordPressPost (limit: 5) {
edges {
node {
Expand Down
2 changes: 1 addition & 1 deletion blog/2019-09-17-gridsome-07/index.md
Expand Up @@ -58,7 +58,7 @@ By default it takes any **.md** files in `baseDir` folder and uses them for file

<!-- Front-matter fields can be queried from GraphQL layer -->
<page-query>
query Documentation ($id: ID!) {
query ($id: ID!) {
documentation(id: $id) {
title
excerpt
Expand Down
2 changes: 1 addition & 1 deletion blog/2019-10-08-integrate-infinite-loading/index.md
Expand Up @@ -42,7 +42,7 @@ To demonstrate how to use `vue-infinite-loading` let's assume a pretty typical B
Your paginated `<page-query>` would look something like this:

```graphql
query Blog($page: Int) {
query ($page: Int) {
posts: allBlogPost(perPage: 10, page: $page) @paginate {
pageInfo {
totalPages
Expand Down
2 changes: 1 addition & 1 deletion docs/components.md
Expand Up @@ -74,7 +74,7 @@ to fetch data from data sources. The results will be stored in a
</template>

<static-query>
query Post {
query {
post (id: "1") {
content
}
Expand Down
2 changes: 1 addition & 1 deletion docs/core-concepts.md
Expand Up @@ -30,7 +30,7 @@ Here is an example:
</template>

<page-query>
query Post($id: ID!) {
query ($id: ID!) {
post(id: $id) {
title
}
Expand Down
4 changes: 2 additions & 2 deletions docs/data-store-api.md
Expand Up @@ -85,7 +85,7 @@ api.loadSource(({ addCollection, store }) => {
The field will contain the referenced node fields in the GraphQL schema:

```graphql
query BlogPost($id: ID!) {
query ($id: ID!) {
blogPost(id: $id) {
title
author1 {
Expand Down Expand Up @@ -140,7 +140,7 @@ api.loadSource(actions => {
You will then be able to query that data in the `page-query` and `static-query` tags in your Vue components with a query like this:

```graphql
query MyData {
query {
allMyData {
edges {
node {
Expand Down
2 changes: 1 addition & 1 deletion docs/images.md
Expand Up @@ -41,7 +41,7 @@ Local image paths from sources can also be compressed. Options like `width`, `he
</template>

<page-query>
query BlogPost ($id: ID!) {
query ($id: ID!) {
post: blogPost (id: $id) {
image (width: 720, height: 200, quality: 90)
}
Expand Down
2 changes: 1 addition & 1 deletion docs/overriding-app.md
Expand Up @@ -14,7 +14,7 @@ The default `App.vue` component inserts the `siteName` and `siteDescription` as
</template>

<static-query>
query App {
query {
metadata {
siteName
siteDescription
Expand Down
2 changes: 1 addition & 1 deletion docs/pages-api.md
Expand Up @@ -116,7 +116,7 @@ Use the context in the page component or as variables in `page-query`.
</template>

<page-query>
query MyPage($customValue: String) {
query ($customValue: String) {
...
}
</page-query>
Expand Down
6 changes: 3 additions & 3 deletions docs/pagination.md
Expand Up @@ -7,7 +7,7 @@ Use the `@paginate` directive in your GraphQL query to add automatic pagination
Place the `@paginate` directive after the collection you want to paginate.

```graphql
query Blog($page: Int) {
query ($page: Int) {
allBlogPost(perPage: 10, page: $page) @paginate {
pageInfo {
totalPages
Expand All @@ -29,7 +29,7 @@ query Blog($page: Int) {
Place the `@paginate` directive after the `belongsTo` field you want to paginate.

```graphql
query Category($page: Int) {
query ($page: Int) {
category {
title
belongsTo(perPage: 10, page: $page) @paginate {
Expand Down Expand Up @@ -80,7 +80,7 @@ export default {
</script>

<page-query>
query Blog($page: Int) {
query ($page: Int) {
allBlogPost(perPage: 10, page: $page) @paginate {
pageInfo {
totalPages
Expand Down
12 changes: 6 additions & 6 deletions docs/querying-data.md
Expand Up @@ -19,7 +19,7 @@ Working with GraphQL in Gridsome is easy and you don't need to know much about G
</template>

<page-query>
query Posts {
query {
posts: allWordPressPost {
edges {
node {
Expand Down Expand Up @@ -54,7 +54,7 @@ You will notice that some of the root fields in your schema are prefixed with `a
#### Find nodes sorted by title

```graphql
query Posts {
query {
allPost(sortBy: "title", order: DESC) {
edges {
node {
Expand All @@ -68,7 +68,7 @@ query Posts {
#### Sort a collection by multiple fields

```graphql
query Posts {
query {
allPost(sort: [{ by: "featured" }, { by: "date" }]) {
edges {
node {
Expand All @@ -92,7 +92,7 @@ The other fields that do not start with `all` are your single entries. They are
#### Example query

```graphql
query Post {
query {
post(id: "1") {
title
}
Expand All @@ -118,7 +118,7 @@ to fetch data from data sources. The results will be stored in a
</template>

<page-query>
query Blog {
query {
posts: allWordPressPost {
edges {
node {
Expand All @@ -141,7 +141,7 @@ Every **Vue component** can have a `<static-query>` block with a GraphQL query t
</template>

<static-query>
query Post {
query {
post(id: "1") {
content
}
Expand Down
4 changes: 2 additions & 2 deletions docs/taxonomies.md
Expand Up @@ -46,7 +46,7 @@ Now, we create a `Tag.vue` file in `src/templates` to have a template for our ta
</template>

<page-query>
query Tag($id: ID!) {
query ($id: ID!) {
tag(id: $id) {
title
belongsTo {
Expand All @@ -72,7 +72,7 @@ That's it! The tag page above will show a list of posts with links to them.
Place the `@paginate` directive after the `belongsTo` field to activate pagination. The query will have a `$page` variable available to pass into the `belongsTo` `page` argument.

```graphql
query Tag($id: ID!, $page: Int) {
query ($id: ID!, $page: Int) {
tag(id: $id) {
title
belongsTo(page: $page) @paginate {
Expand Down
4 changes: 2 additions & 2 deletions docs/templates.md
Expand Up @@ -56,7 +56,7 @@ module.exports = {
Template paths are available in the GraphQL schema with a `path` field. Use a `to` argument for getting paths to additional templates for a collection.

```graphql
query Product ($id: ID!) {
query ($id: ID!) {
product(id: $id) {
path # path to the default template
path(to:"reviews") # path to the reviews template
Expand Down Expand Up @@ -93,7 +93,7 @@ Pages generated from the `templates` configuration will have the node `id` avail
</template>

<page-query>
query Post($id: ID!) {
query ($id: ID!) {
post(id: $id) {
title
content
Expand Down
2 changes: 1 addition & 1 deletion examples/graphql-for-data.md
Expand Up @@ -17,7 +17,7 @@ order: 1

<!-- Query from local GraphQL data layer. -->
<page-query>
query Posts {
query {
allPost {
edges {
node {
Expand Down
2 changes: 1 addition & 1 deletion examples/pagination-support.md
Expand Up @@ -18,7 +18,7 @@ order: 5
</template>

<page-query>
query Posts ($page: Int) {
query ($page: Int) {
allPost (perPage: 10, page: $page) @paginate {
pageInfo {
totalPages
Expand Down
2 changes: 1 addition & 1 deletion examples/taxonomy-pages.md
Expand Up @@ -22,7 +22,7 @@ order: 5
</template>

<page-query>
query Tag ($id: ID!) {
query ($id: ID!) {
tag (id: $id) {
title
belongsTo {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Examples.vue
Expand Up @@ -46,7 +46,7 @@ export default {
</script>

<static-query>
query Example {
query {
examples: allExample (sortBy: "order", order: ASC) {
edges {
node {
Expand Down
2 changes: 1 addition & 1 deletion src/components/home/HomeBlog.vue
Expand Up @@ -30,7 +30,7 @@ export default {
</script>

<static-query>
query BlogPosts {
query {
posts: allBlogPost {
edges {
node {
Expand Down
2 changes: 1 addition & 1 deletion src/components/home/HomeHowItWorks.vue
Expand Up @@ -102,7 +102,7 @@


<static-query>
query Example {
query {
example (path: "/examples/templates") {
content
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/home/HomeIntro.vue
Expand Up @@ -38,7 +38,7 @@
</template>

<static-query>
query HomeIntro {
query {
metaData {
gridsomeVersion
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/home/HomeIntroSimple.vue
Expand Up @@ -49,7 +49,7 @@
</template>

<static-query>
query HomeIntro {
query {
metadata {
gridsomeVersion
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/home/HomeTabs.vue
Expand Up @@ -79,7 +79,7 @@ export default {


<static-query>
query Example {
query {
example (path: "/examples/templates") {
content
}
Expand Down
2 changes: 1 addition & 1 deletion src/layouts/partials/Header.vue
Expand Up @@ -73,7 +73,7 @@
</template>

<static-query>
query Header {
query {
metadata {
gridsomeVersion
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Blog.vue
Expand Up @@ -17,7 +17,7 @@
</template>

<page-query>
query BlogPosts {
query {
posts: allBlogPost {
edges {
node {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Starters.vue
Expand Up @@ -29,7 +29,7 @@ export default {
</script>

<page-query>
query Starters {
query {
defaultStarters: allStarter (
sort: [{ by: "index", order: ASC }]
filter: {
Expand Down
2 changes: 1 addition & 1 deletion src/templates/BlogPost.vue
Expand Up @@ -23,7 +23,7 @@
</template>

<page-query>
query BlogPost ($id: ID!) {
query ($id: ID!) {
post: blogPost (id: $id) {
title
date (format: "D. MMMM YYYY")
Expand Down
2 changes: 1 addition & 1 deletion src/templates/Contributor.vue
Expand Up @@ -27,7 +27,7 @@
</template>

<page-query>
query Contributor ($id: ID!) {
query ($id: ID!) {
contributor (id: $id) {
id
title
Expand Down
2 changes: 1 addition & 1 deletion src/templates/DocPage.vue
Expand Up @@ -5,7 +5,7 @@
</template>

<page-query>
query DocPage ($id: ID!) {
query ($id: ID!) {
doc: docPage (id: $id) {
title
headings (depth: h1) {
Expand Down
2 changes: 1 addition & 1 deletion src/templates/LearnPage.vue
Expand Up @@ -5,7 +5,7 @@
</template>

<page-query>
query LearnPage ($id: ID!) {
query ($id: ID!) {
doc: learnPage (id: $id) {
path
content
Expand Down
2 changes: 1 addition & 1 deletion src/templates/Platform.vue
Expand Up @@ -23,7 +23,7 @@
</template>

<page-query>
query Platform($id: ID!) {
query ($id: ID!) {
platform(id: $id) {
title
belongsTo(sortBy: "index") {
Expand Down
2 changes: 1 addition & 1 deletion src/templates/Starter.vue
Expand Up @@ -165,7 +165,7 @@ export default {
</script>

<page-query>
query Starters($id: ID!) {
query ($id: ID!) {
starter(id: $id) {
title
repo
Expand Down