New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@orbitalhq/orbital-client

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@orbitalhq/orbital-client

A library to execute TaxiQL queries against the Orbital query server

  • 0.1.0-alpha.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11
increased by22.22%
Maintainers
2
Weekly downloads
 
Created
Source

Orbital TypeScript client

A library to execute TaxiQL queries against the Orbital query server.

Getting started

Install the dependency with

npm install @orbitalhq/orbital-client

and create a file called orbital.config.json to the same folder that contains package.json with the following content:

{
  "schemaServerUrl": "<SCHEMA_SERVER_URL>"
}

where you replace <SCHEMA_SERVER_URL> with the URL of the schema server like http://schema-server.orbital.example.com.

Finally, run

npm run orbital:taxonomy:generate

This will generate a taxonomy file called taxonomy.ts next to package.json. This file should be committed to version control and be updated (by re-running npm run orbital:taxonomy:generate) whenever the schema changes.

Once the taxonomy file is generated, you can initialize the client:

import { asArray, buildClient, consoleLogger, HttpQueryClient } from 'orbital-client';
import { taxonomy } from './taxonomy';

const client = buildClient<{}, typeof taxonomy>(
  taxonomy,
  new HttpQueryClient('http://localhost:9022'),
  {
    logger: consoleLogger,
  },
);

and start executing queries

client
  .given(taxonomy.people.FirstName, 'John')
  .find(asArray(taxonomy.people.Person))
  .execute()
  .subscribe((result) => console.log(result[0].firstName));

which sends the following TaxiQL query to be executed on the Orbital server:

given {
        people.FirstName = "John"
}
find { people.Person[] }

You can also access this query by calling .toTaxiQL() on the query builder.

const query = client
  .given(taxonomy.people.FirstName, 'John')
  .find(asArray(taxonomy.people.Person))
  .toTaxiQl();
console.log(query);

FAQs

Package last updated on 23 Feb 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc