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

@fleek-platform/graphql

v2.26.3

Published

Fleek Graphql is the service unifying all graphql service into once.

Downloads

64

Readme

Fleek GraphQL

Fleek Graphql is the service unifying all graphql service into once.

Details

Even though we are using Prisma, we write custom resolvers, mutations and queries. The examples of the mutations and queries are inside the ./src/resolvers directory and schema examples are located in ./src/schema directory.

Adding a new functionality

Generally, this will be new functionality which will include creating a new schema. The schemas are based on the Pothos which are then used to get the data. This is used to resolve the relations such as project or a zone.

Step One:

Start by creating a file under ./src/schema following CamelCase.ts naming convention. At this point check the other files in the directory and how they are done, some are more complex than others, pick one like Domain Schema then copy/paste and adapt. Once you are done with adapting include a new file in the ./src/schema.ts as it is done with other files.

Step Two:

The next step is to create a directory for mutations and queries. Create a directory inside the ./src/resolvers following the camelCase naming convention. Inside create mutations and queries directories. Each directory will contain an implementation file that export default the mutationField with the correct mutation name written in camelCase and a callback function. Now it is time to create a test file. For the references check how other implementations are testing their mutations and queries. The tests are written in a way that will cover as many as possible known cases.

Once you are done with adapting include a new file in the ./src/schema.ts as it is done with other files.

Needed commands

# generate the client code
pnpm generate

# build the package
pnpm build

# test it. requires docker
pnpm test

# to test only failed tests,
# edit the test:watch command ( do not commit ) with correct path then execute it
pnpm test:watch

# start the mysql docker container
pnpm prepare:test

# or all together
pnpm generate && pnpm build && pnpm test

Stack

NodeJS as a runtime environment.

TBD

  • Logger

Development

  1. Install NodeJS from the official website or using nvm.
  2. Install pnpm dependency manager.
  3. Install dependencies usign pnpm i from root path.
  4. Set environmental variables in a new .env file as desired.
  5. pnpm dev, and happy coding!

Testing

  1. Install Node, pnpm and all dependencies for package as it is described above.
  2. You need Docker to run container with Mysql server for integration testing.
  3. Type pnpm prepare:test or set up Mysql container manually
  4. Type pnpm test to run all unit & integration tests

Contributing

  1. Fork it
  2. Create your feature branch: git checkout -b my-new-feature
  3. Run the tests: pnpm test
  4. Commit your changes: git commit -am 'Add some feature'
  5. Push to the branch: git push origin my-new-feature
  6. Create new Pull Request following the corresponding template guidelines