open-index/open-npm huggingface dataset:
npm package: @leftoverstoday/golang-client
Description: WunderGraph Golang Client
Author: WunderGraph Maintainers
Latest version: 0.8.22

# Wundergraph Golang Client

![wunderctl](https://img.shields.io/npm/v/@wundergraph/golang-client.svg)

WunderGraph codegen template plugin to auto-generate a Golang client for your WunderGraph API.

## Getting Started

```shell
npm install @wundergraph/golang-client
```

### Register the codegen template

```ts
// .wundergraph/wundergraph.config.ts
import { golangClient } from '@wundergraph/golang-client';

configureWunderGraphApplication({
  // ...
  // omitted for brevity
  codeGenerators: [
    {
      templates: [
        ...golangClient.all({
          packageName: 'client',
        }),
      ],
      path: './generated/golang/client',
    },
  ],
});
```
npm package: @leftoverstoday/metro-config
Description: WunderGraph Metro Config for React Native and Expo
Author: WunderGraph Maintainers
Latest version: 0.0.1

# WunderGraph Metro Config

![wunderctl](https://img.shields.io/npm/v/@wundergraph/expo.svg)

Official WunderGraph Metro Config for React Native and Expo.

## Getting Started

```shell
npm install @wundergraph/metro-config
```

## Configuration

### metro.config.js

```typescript
// Learn more https://docs.expo.io/guides/customizing-metro
const { wgMetroConfig } = require('@wundergraph/metro-config');
const { getDefaultConfig } = require('expo/metro-config');

const config = getDefaultConfig(__dirname);

module.exports = wgMetroConfig(config);
```

## Advanced

In case you have a custom Metro transformer configured, you can import the WunderGraph transformer and add it to your custom transformer.

```typescript
// custom-transformer.js
const { transform } = require('@wundergraph/metro-config/transformer');

module.exports = {
  transform(file) {
    // custom transforms

    return transform(file);
  },
};
```

## Usage

After configuration the metro config you can use [`@wundergraph/swr`](https://docs.wundergraph.com/docs/clients-reference/swr) or [`@wundergraph/react-query`](https://docs.wundergraph.com/docs/clients-reference/react-query) in your React Native or Expo project.
npm package: @leftoverstoday/nextjs
Description: WunderGraph Next.js integration
Author: WunderGraph Maintainers
Latest version: 0.15.12

# Wundergraph Next.js integration

![wunderctl](https://img.shields.io/npm/v/@wundergraph/nextjs.svg)

WunderGraph codegen template plugin to add deep Next.js integration.

> **Warning**: Only works with WunderGraph.

## Getting Started

```shell
npm install @wundergraph/nextjs swr
```

### 1. Register the codegen template

```ts
// .wundergraph/wundergraph.config.ts
import { NextJsTemplate } from '@wundergraph/nextjs/dist/template';

configureWunderGraphApplication({
  // ...
  // omitted for brevity
  codeGenerators: [
    {
      templates: [new NextJsTemplate()],
    },
  ],
});
```

### 2. Import the package

```tsx
// pages/authentication.ts
import {
  withWunderGraph,
  useQuery,
  useMutation,
  useSubscription,
  useAuth,
  useUser,
} from '.wundergraph/generated/nextjs';

const Example: ExamplePage = () => {
  const { login, logout } = useAuth();
  const { data: user } = useUser();
  const onClick = () => {
    if (user === null || user === undefined) {
      login('github');
    } else {
      logout();
    }
  };
  return (
    <div>
      <h1>Authentication</h1>
      <button onClick={onClick}>${user ? logout : login}</button>
      <p>{JSON.stringify(user)}</p>
    </div>
  );
};
export default withWunderGraph(Example);
```
npm package: @leftoverstoday/rust-client
Description: WunderGraph Rust Client
Author: WunderGraph Maintainers
Latest version: 0.4.3

# Rust Client for WunderGraph

This package implements a code generator that produces a Rust client library to
communicate with your WunderGraph application.

To enable it, add its generator to your WunderGraph application.

```typescript

import { rustClient } from '@wundergraph/rust-client';
...

configureWunderGraphApplication({
    ...
    generate: {
        codeGenerators: [
            ...
            {
                templates: rustClient(),
                path: '../rust/client',
            },
	],
    },
    ...
});
```

This will generate a Rust package at `$WUNDERGRAPH_DIR/../rust/client` the next time you
run `wunderctl generate`.

## Optional configuration

The Rust client generator supports the following configuration options:

- `packageName`: Package name for the generated client package
- `packageVersion`: Package version for the generated client package
npm package: @leftoverstoday/swr
Description: WunderGraph SWR Integration
Author: WunderGraph Maintainers
Latest version: 0.19.8

# WunderGraph SWR Integration

![wunderctl](https://img.shields.io/npm/v/@wundergraph/swr.svg)

This package provides a type-safe integration of [SWR](https://swr.vercel.app/) with WunderGraph.
SWR is a React Hooks library for data fetching. With just one hook, you can significantly simplify the data fetching logic in your project. And it also covered in all aspects of speed, correctness, and stability to help you build better experiences.

> **Warning**: Only works with WunderGraph.

## Getting Started

```shell
npm install @wundergraph/swr swr@2.0.0
```

Before you can use the hooks, you need to modify your code generation to include the base typescript client.

```typescript
// wundergraph.config.ts
configureWunderGraphApplication({
  // ... omitted for brevity
  codeGenerators: [
    {
      templates: [templates.typescript.client],
      // the location where you want to generate the client
      path: '../src/components/generated',
    },
  ],
});
```

Second, run `wunderctl generate` to generate the code.

Now you can use the hooks.

```ts
import { createHooks } from '@wundergraph/swr';
import { createClient, Operations } from './components/generated/client';

const { useQuery, useMutation, useSubscription, useUser, useFileUpload, useAuth } = createHooks<Operations>(
  createClient({ baseURL: 'https://your-wundernode.com', extraHeaders: {}, customFetch: undefined })
);

export const Home: React.FC<{ city: string }> = ({ city }) => {
  const { error, data, isValidating } = useQuery({
    operationName: 'Weather',
    input: { forCity: city },
    liveQuery: true,
  });

  const { data: subData, error: subError } = useSubscription({
    enabled: true,
    operationName: 'Weather',
    input: {
      forCity: 'Berlin',
    },
  });

  const { trigger } = useMutation({
    operationName: 'SetName',
  });
  trigger({ name });

  const { data, error } = useUser();

  const { upload, data, error } = useFileUpload();

  const { login, logout } = useAuth();
};
```

## Options

You can use all available options from [SWR](https://swr.vercel.app/docs/options) with the hooks.
Due to the fact that we use the operationName + variables as **key**, you can't use the `key` option as usual.
In order to use [conditional-fetching](https://swr.vercel.app/docs/conditional-fetching) you can use the `enabled` option.

## Global Configuration

You can configure the hooks globally by using the [SWRConfig](https://swr.vercel.app/docs/global-configuration) context.

In case the context configuration isn't working, it's likely due to multiple versions of SWR being installed.
To resolve this you can import SWRConfig directly from `@wundergraph/swr` to make sure the same instance is used.

```ts
import { SWRConfig, useSWRConfig } from '@wundergraph/swr';
```
npm package: @leftoverstoday/wunderctl
Description: WunderGraph Command Line Interface
Author: WunderGraph Maintainers
Latest version: 0.180.3

# Wunderctl wrapper

![wunderctl](https://img.shields.io/npm/v/@wundergraph/wunderctl.svg)

This package is a wrapper for the wunderctl Go binary. It makes it super easy to run wundergraph commands from your terminal.
This package is not required if you have already installed [`@wundergraph/sdk`](https://github.com/wundergraph/wundergraph/tree/main/packages/sdk). The SDK is shipped with the compatible wunderctl Go binary for development.

> **Note:** This package uses postinstall script to download and install the wunderctl binary.

## Getting Started

```shell
# Install wunderctl
npx @wundergraph/wunderctl
# Help
npx @wundergraph/wunderctl --help
```

> **Warning**: Please use the Go [release](https://github.com/wundergraph/wundergraph/releases) binary to start the wundergraph server in production.

## Misc

You can pass `WG_COPY_BIN_PATH` to copy the installed binary to a specific path. This is useful if you want to use the binary in your CI/CD pipeline.