Skip to content

A GraphQL-based CRUD application designed to manage user details efficiently, providing flexible and structured data access through a modern API architecture.

Notifications You must be signed in to change notification settings

yazy7991/graphql-users

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

25 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

GraphQL Users

A simple GraphQL project that demonstrates how to build a Users API with queries, mutations, and resolvers.

This project is perfect for learning GraphQL basics such as:

  • Defining a schema

  • Creating queries & mutations

  • Handling user data

  • Using a GraphQL server (Apollo)

πŸš€ Features

  • Create, update, delete users

  • Fetch all users or a single user

  • Simple in-memory database

  • GraphQL schema + resolvers

  • Runs with Node.js

πŸ›  Tech Stack

  • Node.js

  • React

  • Apollo Server

  • GraphQL

πŸ“¦ Setup Instructions

1️⃣ Clone the project

2️⃣ Install dependencies

  • npm install

3️⃣ Start the server

  • Include "start": "node [entry file].js" in th script sction of package.json file
  • Then run npm start

The server will run at: πŸ‘‰ http://localhost:4000/graphql

πŸ› Issue: Apollo Client Did Not Export useQuery and useMutation hooks

While integrating Apollo Client with React, I encountered the following error:

Screenshot of App

πŸ” Cause

This issue occurred because:

I was using React 19, which is not fully supported by Apollo Client.

Apollo Client v4+ does not exist, and the correct stable version is Apollo Client 3.x.

React 19 caused Vite to load a broken ESM build of @apollo/client, which was missing hooks like useQuery and useMutation.

βœ… Solution

I solved this error by:

Downgrading React from 19 β†’ 18

  • npm uninstall react react-dom
  • npm install react@18 react-dom@18

Installing a compatible Apollo Client version (3.x)

  • npm install @apollo/client@3.10.0 graphql

After installing the correct versions, Apollo Client exports (useQuery, useMutation, gql, etc.) worked normally, and Vite no longer threw module errors.

About

A GraphQL-based CRUD application designed to manage user details efficiently, providing flexible and structured data access through a modern API architecture.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published