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

@oxfordabstracts/rust-purs-gql

v0.1.10

Published

## Hasura roles

Downloads

319

Readme

Config for purescript-graphql-schema-gen

Hasura roles

To generate schemas for each of your Hasura roles, create a .yaml file and add a ROLES_YAML env var. The yaml should be made up of an array of strings:

- Admin
- User
- Submitter

Outside types

To replace default hasura types with Purescript types, create one or more .yaml files and add them - comma separated - to the OUTSIDE_TYPES_YAML env var.

outside_types:

This section is where you define the schema objects that you want to replace values for.

For example if you wanted to change the types on the user object, you could add the following:

outside_types:
  user:
    with: common
    id: id=UserId
    email: EmailAddress, Data.EmailAddress, emails

This would replace the 'id' field with the 'UserId' type (see 'types' section below). It would also replace the 'email' field with an inline type of the format: [type name], [module name], [package name].

The with key is an optional special key that allows you to define a common set of types to use across multiple objects. For example, if you wanted to use a 'common' set of types on both the 'user' and 'post' objects, you would define 'common' types in the 'templates' section and then add a with: common key to the 'user' and 'post' objects.

types:

This section is where you define shorthand type templates modules containing multiple types. An example for a couple of Id modules is:

types:
  id: $, Data.Id.$, oa-ids
  drId: $, Data.Id.DelegateRegistration.$, oa-ids

The '$' symbol is a placeholder for the type name that the type is called with in templates or outside_types. For example in the 'outside_types' section above, we use id=UserId which is translated into UserId, Data.Id.UserId, oa-ids.

templates:

This section is where you define the common types that you want to use across multiple objects via the with key. For example:

templates
  common:
    author_id: id=AuthorId
    stage_id: id=StageId
    user_id: id=UserId
    created_by: id=UserId
    client_id: id=ClientId
    event_id: id=EventId
  event_types:
    event_title: HTML, Data.HTML
    frequency: Frequency, Data.Frequency
    created_by: id=UserId
    client_id: id=ClientId
    event_id: id=EventId

The keys don't have to exist on the object you call the template for, but any keys that do match will be replaced with the template value.