typesafe nodejs client for transit.land

Overview

TransitLand Graphql Client

transitland-logo-light transitland-logo-dark

npm (scoped) npm (downloads) github test release

About

Since the Transitland released its new and shiny GraphQL API, it is possible to query the API using GraphQL.

The client is being built using genql and updated hourly, if there are upstream changes.

Getting Started

This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.

Prerequisites

First add the library and its peerDependency graphql to your project:

  • npm

    npm install @ioki/transitland-gql-client@latest grapqhl
  • yarn

    yarn add @ioki/transitland-gql-client@latest grapqhl

Setup

  1. Get an API key with access to the gql api at transit.land
  2. Create a client instance:
import { createClient } from '@ioki/transitland-gql-client';

const transitlandClient = createClient({
  apiKey: "YOUR_SUPER_SECRET_API_KEY"
});

Usage

GenQL provides a neat converter from GraphQL to TypeScript. So you can actually just test the queries you want to use in the playground.

Mocking

Using GraphQL's strict type definitions, it is pretty easy to generate a mock server you could use during your tests. An extensive example is stored as a test.

License

Distributed under the MIT License. See LICENSE.md for more information.

Contributing (complexity, asc)

  1. join us @ioki and make this one of your projects
  2. create issues and pull requests, we're happy to enhance this

Contact

ioki logo

ioki Mobility - @ioki_mobility

Project Link: https://github.com/ioki-mobility/transitland-gql-client

Comments
  • Package all schemas

    Package all schemas

    The schema is now distributed across 4 files (here ff.), yet we are only publishing one (schema.graphql). We should release a new version which contains all of them (dist).

    Copy happens here. https://github.com/ioki-mobility/transitland-gql-client/blob/83603aff1abb05dcee10fd69ea8ef17eed2ad5dc/package.json#L31

    opened by wiese 3
  • docs: creating a mocked server

    docs: creating a mocked server

    we currently have a nice setup to create a mocked server instance of transitland based on the schema file. we could either add this mock or at least provide a snippet in the readme and/or use it in a test.

    opened by boredland 1
  • chore(deps): lock file maintenance

    chore(deps): lock file maintenance

    Mend Renovate

    This PR contains the following updates:

    | Update | Change | |---|---| | lockFileMaintenance | All locks refreshed |

    🔧 This Pull Request updates lock files to use the latest dependency versions.


    Configuration

    📅 Schedule: Branch creation - "before 5am on monday" (UTC), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    dependency 
    opened by renovate[bot] 0
  • chore(deps): update actions/setup-node digest to 64ed1c7

    chore(deps): update actions/setup-node digest to 64ed1c7

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | actions/setup-node | action | digest | 8c91899 -> 64ed1c7 |


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    dependency 
    opened by renovate[bot] 0
  • chore(deps): update actions/checkout digest to ac59398

    chore(deps): update actions/checkout digest to ac59398

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | actions/checkout | action | digest | 755da8c -> ac59398 |


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    dependency 
    opened by renovate[bot] 0
  • chore(deps): lock file maintenance

    chore(deps): lock file maintenance

    Mend Renovate

    This PR contains the following updates:

    | Update | Change | |---|---| | lockFileMaintenance | All locks refreshed |

    🔧 This Pull Request updates lock files to use the latest dependency versions.


    Configuration

    📅 Schedule: Branch creation - "before 5am on monday" (UTC), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    dependency 
    opened by renovate[bot] 0
  • chore(deps): lock file maintenance

    chore(deps): lock file maintenance

    Mend Renovate

    This PR contains the following updates:

    | Update | Change | |---|---| | lockFileMaintenance | All locks refreshed |

    🔧 This Pull Request updates lock files to use the latest dependency versions.


    Configuration

    📅 Schedule: Branch creation - "before 5am on monday" (UTC), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    dependency 
    opened by renovate[bot] 0
  • chore(deps): lock file maintenance

    chore(deps): lock file maintenance

    Mend Renovate

    This PR contains the following updates:

    | Update | Change | |---|---| | lockFileMaintenance | All locks refreshed |

    🔧 This Pull Request updates lock files to use the latest dependency versions.


    Configuration

    📅 Schedule: Branch creation - "before 5am on monday" (UTC), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    dependency 
    opened by renovate[bot] 0
  • chore(deps): update actions/checkout digest to 755da8c

    chore(deps): update actions/checkout digest to 755da8c

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | actions/checkout | action | digest | 7dd9e2a -> 755da8c |


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    dependency 
    opened by renovate[bot] 0
  • chore(deps): update actions/checkout digest to 7dd9e2a

    chore(deps): update actions/checkout digest to 7dd9e2a

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | actions/checkout | action | digest | 2541b12 -> 7dd9e2a |


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    dependency 
    opened by renovate[bot] 0
  • chore(deps): lock file maintenance

    chore(deps): lock file maintenance

    Mend Renovate

    This PR contains the following updates:

    | Update | Change | |---|---| | lockFileMaintenance | All locks refreshed |

    🔧 This Pull Request updates lock files to use the latest dependency versions.


    Configuration

    📅 Schedule: Branch creation - "before 5am on monday" (UTC), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    dependency 
    opened by renovate[bot] 0
  • remove wsClient from bundle

    remove wsClient from bundle

    currently, wsClient is being pulled into the bundle, no matter what.

    we should change that as afaik transitland doesn't offer websocket connections and thus this is useless bloat.

    depends on https://github.com/remorses/genql/issues/89

    opened by boredland 0
  • Correctly type custom scalars

    Correctly type custom scalars

    Transitland has some custom scalars, like Time, Geometry, Polygon etc.

    Genql supports customs scalars only for primitives (https://github.com/remorses/genql/issues/86, https://github.com/remorses/genql/issues/57). While I hope we could find a solution in genql, alternative generators like grapqhl-zeus or graphql-typed-client provide type-safe transformers for scalars. We could think about switching there.

    opened by boredland 0
  • Dependency Dashboard

    Dependency Dashboard

    This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

    Awaiting Schedule

    These updates are awaiting their schedule. Click on a checkbox to get an update now.

    • [ ] chore(deps): lock file maintenance

    Detected dependencies

    github-actions
    .github/workflows/release.yaml
    • actions/checkout v3@ac593985615ec2ede58e132d2e21d2b1cbd6127c
    • boredland/action-commit-store 1.3.0@841a879cc6b4bfaebd247c17ad7b72cbf76c7e77
    • actions/setup-node v3@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
    • stefanzweifel/git-auto-commit-action v4@3ea6ae190baf489ba007f7c92608f33ce20ef04a
    .github/workflows/test.yaml
    • actions/checkout v3@ac593985615ec2ede58e132d2e21d2b1cbd6127c
    • actions/setup-node v3@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
    npm
    package.json
    • @genql/runtime 2.10.0
    • @commitlint/cli ^17.1.2
    • @commitlint/config-conventional ^17.1.0
    • @csmith/release-it-calver-plugin ^2022.5.13
    • @genql/cli 2.10.0
    • @graphql-tools/mock ^8.7.5
    • @graphql-tools/schema ^9.0.3
    • @release-it/conventional-changelog ^5.1.0
    • @types/chance ^1.1.3
    • @types/connect ^3.4.35
    • @types/geojson ^7946.0.10
    • @types/jest ^29.0.0
    • chance ^1.1.8
    • connect ^3.7.0
    • dotenv ^16.0.2
    • express-graphql ^0.12.0
    • graphql ^16.6.0
    • husky ^8.0.1
    • jest ^29.0.0
    • npm-run-all ^4.1.5
    • release-it ^15.4.1
    • ts-jest ^29.0.0
    • ts-node ^10.9.1
    • tsup ^6.2.3
    • typescript ^4.8.3
    • graphql *

    • [ ] Check this box to trigger a request for Renovate to run again on this repository
    opened by renovate[bot] 0
Releases(2022.11.29)
Owner
ioki
ioki
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
PEARL (Planetary Computer Land Cover Mapping) Platform API and Infrastructure

PEARL API & Infrastructure PEARL is a landcover mapping platform that uses human in the loop machine learning approach. This repository contains the A

Development Seed 47 Dec 23, 2022
Open Harvest is a technology designed farmers to publicly share the details of their crops/land to allow all farmers to stay informed on the best crops they can grow without risking a surplus crisis.

OpenHarvest OpenHarvest is a web application designed to balance farming production in India. Farmers in India are struggling with marketing their cro

Call for Code® with The Linux Foundation 11 Dec 8, 2022
Package publishing for deno.land/x/polkadot

deno/polkadot Experimental This is the first release of the Deno interfaces for the polkadot-js family, as such it still needs a lot of testing and co

@polkadot{.js} 22 Dec 3, 2022
End-to-end typesafe APIs with tRPC.io in SvelteKit applications

✨ tRPC-SvelteKit End-to-end typesafe APIs with tRPC.io in SvelteKit applications. No code generation, run-time bloat, or build pipeline. ❤️ ???? See b

Ionut-Cristian Florescu 307 Dec 29, 2022
TypeSafe MongoDB Atlas Data API SDK for Deno & Deno Deploy

Atlas SDK atlas_sdk is a TypeSafe MongoDB Atlas Data API SDK for Deno & Deno Deploy Links Docs Import Replace LATEST_VERSION with current latest versi

Erfan Safari 20 Dec 26, 2022
Typesafe API for processing iterable data in TypeScript and JavaScript.

Stream API Type-safe API for processing iterable data in TypeScript and JavaScript similarly to Java 8 Stream API, LINQ or Kotlin Sequences. Unlike Rx

Norbert Szilagyi 31 Aug 4, 2022
Quick T3 Stack with SvelteKit for rapid deployment of highly performant typesafe web apps.

create-t3svelte-app Just Build npx create-t3svelte-app Outline Get Building npm yarn More Info ?? Early Version Note Prisma Requirements Available Tem

Zach 85 Dec 26, 2022
End-to-end typesafe APIs in Astro wesbites made easy

Astro x tRPC ?? End-to-end typesafe APIs in Astro wesbites made easy View Demo · Report Bug · Request Feature ?? Introducing astro-trpc astro-trpc is

Happydev 61 Dec 30, 2022
CLI Progress Bar implemented in NodeJS to track Time, ETA and Steps for any long running jobs in any loops in JS, NodeJS code

NodeJS-ProgressBar CLI Progress Bar for NodeJS and JavaScript to track Time, ETA and Steps for any long running jobs in any loops in JS, NodeJS code D

Atanu Sarkar 5 Nov 14, 2022
A CLI tool to create a NodeJS project with TypeScript CTSP is a CLI tool to make easier to start a new NodeJS project and configure Typescript on it.

CTSP- Create TS Project A CLI tool to create a NodeJS project with TypeScript CTSP is a CLI tool to make easier to start a new NodeJS project and conf

Jean Rodríguez 7 Sep 13, 2022
🔑 NodeJS keycloak admin client

Keycloak Admin Client Features TypeScript supported Latest Keycloak version supported Complete resource definitions Well-tested for supported APIs Ins

Super St@r 16 Jul 13, 2022
A remote nodejs Cache Server, for you to have your perfect MAP Cache Saved and useable remotely. Easy Server and Client Creations, fast, stores the Cache before stopping and restores it again!

remote-map-cache A remote nodejs Cache Server, for you to have your perfect MAP Cache Saved and useable remotely. Easy Server and Client Creations, fa

Tomato6966 8 Oct 31, 2022
Unofficial API client for the Tidbyt API. Use this client to control Tidbyt devices and integrate with other services.

Tidbyt Client for Node.js Unofficial API client for the Tidbyt API. Use this client to control Tidbyt devices and integrate with other services. Insta

Nicholas Penree 19 Dec 17, 2022
An users NodeJS API without packages libs or frameworks!

NodeJS Users API - Without Frameworks And Packages ?? Table of Contents About Getting Started Usage Built Using Authors ?? About Purpose of this proje

Nathan Cotrim Lemos 31 Feb 7, 2022
O objetivo dessa aplicação era criar um frontend feito totalmente em Javascript, sem nenhum arquivo HTML ou CSS pré-criado. Além disso, esse projeto também é o frontend da minha API 100% NodeJS.

Projeto HTML 100% Javascript Front-end feito "sem HTML" Conteúdos ➜ Sobre o projeto ➜ O que aprendi ➜ Como usar ?? Sobre o projeto Voltar ao topo O ob

João Victor Negreiros 19 Aug 3, 2021
A NodeJS Console Logger with superpowers

LogFlake LogFlake is a NodeJS console logger with superpowers. It has the same API as the usual Console but with beautified output, a message header w

Felippe Regazio 57 Oct 9, 2022
Role based authentication for NodeJS and ExpressJS

Role based authentication Authentication service made for ExpressJS and MongoDB using JWT. We tried to make it as clean and structured as possible. We

null 4 Oct 3, 2021