Categorygithub.com/OmShirke/gRPC-GraphQL
repositorypackage
0.0.0-20250104195702-ce2df12dd8f7
Repository: https://github.com/omshirke/grpc-graphql.git
Documentation: pkg.go.dev

# README

gRPC-GraphQL

Overview

The gRPC-GraphQL service is a standalone microservice designed to provide a GraphQL interface to interact with other microservices in a distributed system. It integrates gRPC for communication with backend services, enabling efficient data fetching via GraphQL queries.

Features

1. Implements GraphQL server to interact with other microservices.
2. Uses gRPC for efficient communication with backend services.
3. Supports both query and mutation resolvers for CRUD operations.
4. Uses gqlgen for GraphQL schema generation.

Project Structure

account_resolver.go: Resolver for account-related GraphQL queries.
app.dockerfile: Dockerfile to build and deploy the microservice.
generated.go: Generated GraphQL types and resolvers.
go.mod: Go module definition.
go.sum: Go module checksum file.
gqlgen.yml: gqlgen configuration file.
graph.go: GraphQL query and mutation definitions.
main.go: Main entry point for the GraphQL server.
models.go: GraphQL server data models.
models_gen.go: Generated GraphQL data models.
mutation_resolve.go: Resolver for handling GraphQL mutations.
query_resolver.go: Resolver for handling GraphQL queries.
schema.graphql: GraphQL schema file defining types and operations.

Installation and Setup

Prerequisites

Go (version 1.20+ recommended)
Docker and Docker Compose
gqlgen (for GraphQL schema generation)

Clone this repo:

git clone https://github.com/OmShirke/gRPC-GraphQL.git
cd gRPC-GraphQL

Build the Docker image:

docker build -t grpc-graphql-service -f app.dockerfile .

Start the services:

docker-compose up

Generate GraphQL schema and resolvers:

go run github.com/99designs/gqlgen generate

Access the GraphQL server at localhost: (replace with your server's port).