Skip to content
Open
Changes from all commits
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
103 changes: 103 additions & 0 deletions src/examples/NpmDownloads.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
---
description: |
Cool!
contributedBy: "@sgrove"
variables: ""
title: "NpmDownloads"
result: |
"{\"errors\":[{\"message\":\"Missing auth for GitHub. Please reauthenticate.\",\"path\":[\"npm\",\"package\",\"repository\",\"sourceRepository\"],\"extensions\":{\"service\":\"github\",\"type\":\"auth/missing-auth\",\"traceId\":\"e5242891-c0ef-46a6-9240-fe82db85ccd6\"}}],\"data\":{\"npm\":{\"package\":{\"name\":\"graphql\",\"downloads\":{\"lastMonth\":{\"count\":18748116}},\"repository\":{\"sourceRepository\":null}}}}}"
---

```graphql
query NpmDownloads($name: String = "graphql") {
npm {
package(name: $name) {
name
downloads {
lastMonth {
count
}
}
repository {
sourceRepository {
... on GitHubRepository {
id
name
}
}
}
}
}
}

query Rss(
$url: String = "https://www.heavybit.com/category/library/podcasts/jamstack-radio/feed/"
) {
rss {
rss2Feed(url: $url) {
items {
title
content
enclosure {
length
url
}
}
}
}
}

mutation PlaySpotifySong(
$trackId: String!
$positionMs: Int = 0
) {
spotify {
playTrack(
input: {
trackIds: [$trackId]
positionMs: $positionMs
}
) {
player {
isPlaying
progressMs
item {
id
name
}
}
}
}
}

subscription MySubscription {
npm {
allPublishActivity {
package {
id
name
description
repository {
sourceRepository {
... on GitHubRepository {
id
name
issues(
first: 10
orderBy: {
field: CREATED_AT
direction: DESC
}
states: OPEN
) {
totalCount
}
}
}
}
}
}
}
}

```