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

@teip/create-flow-types

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@teip/create-flow-types

Generate flow types using a schema and a query.

latest
npmnpm
Version
0.2.3
Version published
Maintainers
2
Created
Source

Generate Flow Types

Generate flow types using a schema and a query.

Design

The generator exports a function that turns a GraphQLSchema and a parsed GraphQL AST into a Babel AST that represents the type structure.

function documentToModule(parent: GraphQLSchema, node: DocumentNode): BabelAST

To achieve this the program is composed recursively into functions that solve a subtask of the overall task. This works because the Flow type system and the GraphQL type system are similar enough that sub-solutions can form the overall solution.

How does this compare to Apollo Codegen

Apollo Codegen targets multiple platforms such as Typescript, Scala and Swift. By focusing on flow types this project tries to iterate faster and make customisation in different dimensions easier.

Also teip requires your GraphQL documents to be written inside of pure .graphql files. This allows teip to create .graphql.flow files next to these files that contain the definitions for the queries inside.

FAQs

Package last updated on 13 Jul 2021

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