Gathering detailed insights and metrics for next-graphql-let-plugin
Gathering detailed insights and metrics for next-graphql-let-plugin
Gathering detailed insights and metrics for next-graphql-let-plugin
Gathering detailed insights and metrics for next-graphql-let-plugin
next-plugin-graphql-let
Automatically configures webpack for graphql-let usage in Next.js.
@crabas0npm/voluptatem-aspernatur-ducimus
> Plant the "@crabas0npm/voluptatem-aspernatur-ducimus" for your next Typescript project and let it grow with this useful lib, providing basic functionalities handy in most projects.
Frictionless automatic GraphQL Typescript generation setup for Next.js
npm install next-graphql-let-plugin
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
8 Stars
12 Commits
1 Watchers
1 Branches
1 Contributors
Updated on Feb 14, 2025
Latest Version
1.0.0
Package Id
next-graphql-let-plugin@1.0.0
Unpacked Size
11.49 kB
Size
5.08 kB
File Count
9
NPM Version
7.14.0
Node Version
14.17.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
4
This Next.js plugin makes it easy to setup graphql-let in your Next.js project. The main purpose of this plugin is to eliminate configuration and re-generation friction that you might experience with pure graphql-let
setup. Mainly this plugin make next.config.js
cleaner and re-generates the types and query hooks on every yarn dev
or yarn build
run.
Although Next.js plugins usually don't require a lot of setup to get started, this one required couple of steps to be completed before it will work:
Note that some of these dependencies are here to support @apollo/client
integration specifically.
With yarn:
1yarn add @apollo/client graphql graphql-let 2yarn add -D next-graphql-let-plugin @graphql-codegen/cli @graphql-codegen/import-types-preset @graphql-codegen/typescript @graphql-codegen/typescript-operations @graphql-codegen/typescript-react-apollo
With npm:
1npm i @apollo/client graphql graphql-let 2npm i -D next-graphql-let-plugin @graphql-codegen/cli @graphql-codegen/import-types-preset @graphql-codegen/typescript @graphql-codegen/typescript-operations @graphql-codegen/typescript-react-apollo
1// next.config.js 2const withGraphQLLetPlugin = require("next-graphql-let-plugin")({ 3 // Plugin options go here... 4}); 5 6module.exports = withGraphQLLetPlugin({ 7 // Regular config goes here... 8});
graphql-let.yml
Since graphql-let
does not allow to use json configuration that could be defined through the code, we have to create a graphql-let.yml
file with the configuration. Luckily, this plugin will create that file for you if you don't have one - su just run:
1# yarn 2yarn dev 3 4# npm 5npm run dev
Then, you just have to customize the configuration to your needs. For starters and simple schema we recommend following schema:
1schema: "**/*.graphqls" 2documents: "**/*.graphql" 3plugins: 4 - typescript-operations 5 - typescript-react-apollo 6cacheDir: .cache
You can also provide a remote schema in the config by pointing it to the GraphQL API url.
You can find full options that are available for you in graphql-let.yml
config here.
You will need to create a GraphQL client provider. To have the provider work on every page in your Next.js project it's best to add it to the _app.tsx
file. You can find a full guide on how to setup Apollo Client in a frontend app on this page, but here's a simple example you can use:
1import type { AppProps } from "next/app"; 2import { ApolloClient, ApolloProvider, InMemoryCache } from "@apollo/client"; 3 4const client = new ApolloClient({ 5 uri: "", // Enter URL to your API here 6 cache: new InMemoryCache(), 7}); 8 9function MyApp({ Component, pageProps }: AppProps) { 10 return ( 11 <ApolloProvider client={client}> 12 <Component {...pageProps} /> 13 </ApolloProvider> 14 ); 15} 16 17export default MyApp;
yarn dev
or npm run dev
That's it! You can now add .graphql
files to your project with queries defined in them and graphql-let
will generate fetching functions for you that you can use straight in your project like so:
1# lib/queries/author.graphql 2query GetAuthors { 3 authors { 4 id 5 name 6 } 7}
The above query gets converted into a query hook like this:
1import { useGetAuthorsQuery } from "../lib/queries/author.graphql"; 2 3export default function Home() { 4 const { data } = useGetAuthorsQuery(); 5 6 return ( 7 <ul> 8 {data?.authors.map((author) => ( 9 <li key={author.id}>author.name</li> 10 ))} 11 </ul> 12 ); 13}
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
SAST tool detected: CodeQL
Details
Reason
license file detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/12 approved changesets -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
26 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More