New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@polywrap/schema-compose

Package Overview
Dependencies
Maintainers
2
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@polywrap/schema-compose

Polywrap Schema Composition

latest
Source
npmnpm
Version
0.12.2
Version published
Maintainers
2
Created
Source

Polywrap Schema Compose (@polywrap/schema-compose)

Composes GraphQL schema source and typings for passing to schema-bind.

Usage

import path from "path";
import { readFileSync } from "fs";
import { ComposerOptions, ComposeFilter, composeSchema } from "@polywrap/schema-compose";
import { TypeInfo } from "@polywrap/schema-parse";

const schemaPath = "input/module.graphql"

const schema = readFileSync(schemaPath);

const resolveExternal = (uri: string): Promise<string> => {
  return Promise.resolve(readFileSync(`imports-ext/${uri}/schema.graphql`) || "");
};

const resolveLocal = (path: string): Promise<string> => {
  return Promise.resolve(readFileSync(path) || "");
};

const input: ComposerOptions = {
  schemas: [{
    schema,
    absolutePath,
  }],
  abiResolver: (
    importFrom: string,
    schemaFile: SchemaFile
  ) => Promise<Abi | SchemaFile> => {
    ...
  },
  output: ComposerFilter.All
};

const output: ComposerOutput = composeSchema(input);

const { schema: string, typeInfo: TypeInfo } = output;

FAQs

Package last updated on 23 Nov 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