https://github.com/stepzen-dev/sheetslink
https://github.com/stepzen-dev/sheetslink
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/stepzen-dev/sheetslink
- Owner: stepzen-dev
- License: mit
- Created: 2021-05-06T19:54:33.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-05-06T20:00:29.000Z (about 5 years ago)
- Last Synced: 2025-04-25T11:50:40.841Z (about 1 year ago)
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sheetslink
This is an example schema that links two Google sheets together via the StepZen @materializer directive. We've added a field named `Players` to the `Team` type like so:
```
Players: [Player]
@materializer(query:"playersByTeam" arguments:[{name:"team" field:"Team__A"}])
```
In the schema for the `Player` type we've added a query that searches the sheet for players matching the given team:
```
playersByTeam(team: String!): [Player]
@rest(endpoint:"https://sheets.apis.stepzen.com/159aOCvUOumcKE1kdRZ-6ohTkbjs2VfSEbSLdUjXDqMk/383008360?q=where%20C%20%3D%20%22$team;%22")
```
The trickiest part is url-encoding the "where" clause we use to define the query. It decodes to:
`where C = "$team;"`