Skip to content

HelibertoArias/RoccoGraphQL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Logo

Rocco Company GraphQL API

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Contact

About The Project

This project is a GraphQL API for handling basic information in Rocco Company.

Here we will find Companies and Employees.

Database

(back to top)

Built With

This GraphQL API has build using ASP.NET Core Web API using .NET 6.0. Some of the Nuget Packages used here are:

(back to top)

Getting Started

Here some steps to run the application.

Prerequisites

  • Visual Studio 2022 or Visual Studio Code
  • SDK .NET 6
  • SQL Server Express 2019 or other version will works.

Installation

To start using the application you should.

  1. Clone the repo.
    git clone https://github.com/helibertoarias/RoccoGraphQL.git
  2. Open the solution RoccoGraphQL.sln and build to restore the Nuget Packages.
  3. Open the file ./RoccoGraphQL/appsettings.development.json and update the user and password. Here there is an example using a SQL Express connection.
    "ConnectionStrings": {
      "RoccoConnectionString": "localhost\\SQLEXPRESS; database=Rocco; Integrated Security=true",
  4. In Visual Studio 2022 open a new terminal Package Manager Console. Then, run the following command to create the database.
    Update-Database
  5. After this you can run the application. The Playground UI will show up in the following URL https://localhost:7070/ui/playground

(back to top)

Usage

To validate the GraphQL API you can try this in the Playground UI.

  1. Simple query: Run a query to get information for all companies.
{
  companies {
    name
    address
    country    
  }
}
  1. Related query: Run a query to get information for all companies and related employees.
{
  companies {
    name
    employees {
      name
      position
    }  
  }
}
  1. Mutation: Run this mutation to add a new company.
mutation($company: companyInput!){
    createCompany(company: $company){
        name
        address
        country
    }
}

// Set this into the query variables section

{
  "company": {
    "name":     "My company ACME",
    "address":  "Street 90",
    "country": "USA"
  }
}

(back to top)

Contact

Heliberto Arias - @helibertoarias - [email protected]

Project Link: https://github.com/helibertoarias/RoccoGraphQL

(back to top)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages