Giter Club home page Giter Club logo

transitland-gql-client's Introduction

TransitLand Graphql Client

transitland-logo-light transitland-logo-dark

npm (scoped) size 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

First add the library and its peerDependency to your project:

  • npm

    npm i @ioki/transitland-gql-client@latest
  • yarn

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

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",
  fetch: fetchClient // not needed for browser and node >= v18 (and >=v16 with --experimental-fetch)
});

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

transitland-gql-client's People

Contributors

boredland avatar github-actions[bot] avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

transitland-gql-client's Issues

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.

"generate:3-cp-schema": "cp src/_client/schema.graphql dist/schema.graphql",

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 remorses/genql#89

Dependency Dashboard

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

Pending Approval

These branches will be created by Renovate only once you click their checkbox below.

  • chore(deps): update actions/checkout action to v4
  • chore(deps): update actions/setup-node action to v4
  • chore(deps): update boredland/action-commit-store action to v2
  • chore(deps): update conventional-changelog to v19 (major) (@commitlint/cli, @commitlint/config-conventional)
  • chore(deps): update dependency @csmith/release-it-calver-plugin to v2023
  • chore(deps): update dependency @genql/cli to v6
  • chore(deps): update dependency @release-it/conventional-changelog to v8
  • chore(deps): update dependency @types/node to v20
  • chore(deps): update dependency husky to v9
  • chore(deps): update dependency release-it to v17
  • chore(deps): update dependency tsup to v8
  • chore(deps): update dependency typescript to v5
  • chore(deps): update graphql-tools monorepo (major) (@graphql-tools/mock, @graphql-tools/schema)
  • chore(deps): update stefanzweifel/git-auto-commit-action action to v5
  • ๐Ÿ” Create all pending approval PRs at once ๐Ÿ”

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): update dependency @types/node to v18.19.33

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/release.yaml
  • actions/checkout v3@f43a0e5ff2bd294095638e18286ca9a3d1956744
  • boredland/action-commit-store 1.3.1@1dc8f93e093a9d3d1ba6da3ef46fe06802a4fe74
  • actions/setup-node v3@1a4442cacd436585916779262731d5b162bc6ec7
  • stefanzweifel/git-auto-commit-action v4@3ea6ae190baf489ba007f7c92608f33ce20ef04a
.github/workflows/test.yaml
  • actions/checkout v3@f43a0e5ff2bd294095638e18286ca9a3d1956744
  • actions/setup-node v3@1a4442cacd436585916779262731d5b162bc6ec7
npm
package.json
  • @commitlint/cli ^17.1.2
  • @commitlint/config-conventional ^17.1.0
  • @csmith/release-it-calver-plugin ^2022.5.13
  • @genql/cli 3.0.5
  • @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
  • @types/node ^18.14.1
  • 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

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.

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Location: renovate.json
Error type: The renovate configuration file contains some invalid settings
Message: Invalid configuration option: github

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.