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

update README docs with kotlin code [compatible with 7.0.0] #681

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
kotlin doc for #Alias
  • Loading branch information
ibrahimAlii committed Dec 23, 2020
commit 3758d6329f1fbbc40e1d9fb0715cc140f23d4b2a
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,22 @@ Storefront.query(rootQueryBuilder ->
);
```

**Kotlin**
```kotlin
val query = Storefront.query { query ->
query.node(ID("NkZmFzZGZhc"), { nodeQuery ->
nodeQuery.onCollection { collectionQuery ->
collectionQuery.withAlias("collection").title().description()
}
}).node(ID("GZhc2Rm"), { nodeQuery ->
nodeQuery.onCollection { collectionQuery ->
collectionQuery.withAlias("product").title().description()
}
})
}
```


Accessing the aliased nodes is similar to a plain node:

```java
Expand Down