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

@authentified/retool-scripts

v0.14.0

Published

A collection of Retool scripts designed to make integrating with [Gadget's APIs](https://gadget.dev/) a lot easier.

Downloads

391

Readme

@authentified/retool-scripts

A collection of Retool scripts designed to make integrating with Gadget's APIs a lot easier.

Installation

Add the Authentified Retool scripts Unpkg URL to your Retool libraries.

https://unpkg.com/@authentified/retool-scripts

Install Authentified's retool scripts via Unpkg https://unpkg.com/@authentified/retool-scripts

If needed, you can also include via various package managers:

npm install @authentified/retool-scripts
yarn add @authentified/retool-scripts
pnpm add @authentified/retool-scripts

Functions

transformFilterStackToGraphQLFilter

This function translates a Retool table filter stack to Gadget's GraphQL Filters. Create a transformer also called transformFilterStackToGraphQLFilter and paste the following code.

return window.Authentified.transformFilterStackToGraphQLFilter(
  {{ myTable.filterStack }}
)

This Transformer can now be used to generate the filter argument for your GraphQL query.

You can also append an extra GraphQL filter as a second argument if you want to ensure particular filters are passed to a query. If the filter stack is empty, the extra parameter will be used as the default filter:

return window.Authentified.transformFilterStackToGraphQLFilter(
  {{ myTable.filterStack }},
  { status: { equals: "published" }}
)

Filtering on related models

To enable filtering on related models, you will need to change the ID of the column to a dot notation representation of the filter. For example if you have a reference to a model named product, and you want to search by a field called title you just change the ID of your column to product.title and transformFilterStackToGraphQLFilter will do the rest.

Related model filtering

transformSortArrayToGraphQLSortOrder

This function translates a Retool sort array to Gadget's GraphQL SortOrder. Create a transformer also called transformSortArrayToGraphQLSortOrder and paste the following code.

return window.Authentified.transformSortArrayToGraphQLSortOrder(
  {{ listingsTable.sortArray }}
)

You can also prepend an additional SortBy object it you want to ensure a particular default SortBy is passed to a query:

return window.Authentified.transformSortArrayToGraphQLSortOrder(
  {{ listingsTable.sortArray }},
  { createdAt: "Descending" },
)

Example with Retool GraphQL query

Use with GraphQL Query