Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fuse

Package Overview
Dependencies
Maintainers
2
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fuse

The magical GraphQL framework

  • 0.8.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.6K
increased by50.59%
Maintainers
2
Weekly downloads
 
Created
Source

Fuse.js

Fuse.js: End-to-end typesafe data fetching for frontend teams at scale

Getting Started

Before you begin

Before you start using Fuse.js, you need to have:

  • Familiarity with TypeScript
  • A Next.js app*

*Note that a Fuse.js data layer can also be developed and deployed outside of Next.js. However, our current focus is on making the experience with Next.js great, so expect rough edges elsewhere.

Setting up your Fuse.js data layer

When you are in your Next.JS app run the following command, this will install all the packages and generate the files you need.

npm create fuse-app

Next, run npm run dev and... That’s it! Fuse.js will now serve a GraphQL API at /api/fuse.

Querying your data layer

import { graphql } from '@/fuse'
import { execute } from '@/fuse/server'

const UserQuery = graphql(`
  query User($id: ID!) {
    user(id: $id) {
      id
      name
    }
  }
`)

export default async function Page() {
  const result = await execute({
    query: UserQuery,
    variables: { id: '1' },
  })

  return <p>Welcome {result.data?.user?.name}</p>
}

Docs

Read the documentation for more information about using Fuse.js.

Quicklinks to some of the most-visited pages:

License

Licensed under the MIT License, Copyright © 2023-present Stellate, Inc.

See LICENSE for more information.

FAQs

Package last updated on 08 Dec 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc