npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

flow-graphql

v0.7.0

Published

flow typed grapgql

Downloads

13

Readme

flow-GraphQL.js

Add flow-type outputs for Graphql

Changelog

v0.7.0 (origin Graphql v0.7.0,with PR#479, cause tag v0.7.0 has some wrong Flow typo).

The Official Graphql upcoming release plan(So this flow-GraphQL was temporarily used until v0.8.0): v0.7.0: Introduce all latest improvements and changes to graphql-js, but no flow-types. v0.8.0-beta: Shortly after, a beta release will contain flow-types. v0.8.0: After some time for people to test and report any issues, a new non-beta release will contain flow types.

v0.6.7 (Graphql v0.6.2)

Update to Graphql v0.6.2.

v0.6.6 (Graphql v0.6.1)

GraphQLObjectTypeConfig<TSource> to GraphQLFieldResolveFn<TSource, TResult> Make user can do a whole top-bottom Flow check between their resolvers. With the Flow typed feature, user can ensure his data structure is correspond to schema . ex: starWarsData.js L103

More details see the src/tests/starWarsSchema.js A simple demonstration:

  type DCPost;
  type DComment;
  type DUser;
  const Post = new GraphQLObjectType({
    name: 'Post',
    fields: () => ({
      ...
      comment: {
        type: new GraphQLList(Comment),
        resolve: (src:DPost):DComment[] => { // Flow check DPost -> DComment[]
          return ...;
        } }
    }),
  });

  const Comment = new GraphQLObjectType({
    name: 'Comment',
    fields: () => ({
      ...
      user: {
        type: User,
        resolve: (src:DComment):DUser => { // DComment -> DUser
          return ...;
        }
      },
    }),
  });

  const User = new GraphQLObjectType({
      ...
  });

Note: Because in v0.61 ,in source code use a any type to force cast TSource. So it is user's responsibility to check the Data Type is not typo. In above code , if resolve: (src:DPost):DComment is typo to resolve: (src:DPost):DSomeAnotherType[](and user return a wrong data), Flow will still pass. Flow will not check DSomeAnotherType is DComment,cause of DSomeAnotherType -> any -> DComment

v0.6.5 (Graphql v0.6.1)

update to the latest master (Graphql v0.6.1) update Flow to 0.28

v0.6.3 (Graphql v0.6.0)

printSchema to this

type printStyle = 'alphabet' | 'hierarchy';
export function printSchema(
  schema: GraphQLSchema,style: printStyle = 'alphabet'): string {
  switch (style) {
    case 'hierarchy':
      return printFineSchema(schema, n => !isSpecDirective(n));
    case 'alphabet':
    default:
      return printFilteredSchema(schema, n => !isSpecDirective(n),
      isDefinedType);
  }
}