Giter VIP home page Giter VIP logo

wakesport-products-graphql-prisma-server's Introduction

Wakeboard Store App GraphQL Prisma Server

GraphQL, PostgreSQL, Docker, Prisma, Nexus, Apollo

⭐ Prisma as your data modeling tool
Prisma was used, see prisma folder here: https://github.com/skaduusch/graphql-postgres-docker/tree/master/prisma

⭐ Docker-based PostgreSQL, MySQL, or MongoDB as your data store
See below on how to set up the docker container

⭐ At least 3 Query resolvers to get data from your server
See queries here: https://github.com/skaduusch/graphql-postgres-docker/blob/master/src/query.js

⭐ At least 2 Mutation resolvers allowing users to create, update, or upsert an item. ⭐ At least 1 Mutation resolver allowing users to delete an item.
See mutations here: https://github.com/skaduusch/graphql-postgres-docker/blob/master/src/mutation.js

⭐ Your datastore will contain at least 25 items
Items populated/seeded from this json file: https://github.com/skaduusch/graphql-postgres-docker/blob/master/prisma/data/wake-products.json

⭐ Your app will be deployable locally using Docker and will have seed data entered into the datastore.

To deploy the server once downloading the code base and while Docker is running on your system, run the following npm scripts in order:

npm install
npm run launchDocker
npm run createDB
npm run generate
npm run seed

You can then launch the Prisma Studio (on port :4000) to view the information in the database with:

npm run dev

Or you can experiment with making queries in the Apollo server (on port :5000) by running:

npm start
See Query Samples.

Query Products:

query allProducts {
	Products {
		id
		name
		category
		description
		price
		imageUrl
	}
}
query singleProduct {
	Product(id: "ck8atgsrx0007kr7b3w3azya1") {
		id
		name
		category
		description
		price
		imageUrl
	}
}
query productCategory {
	Category(category: "Wakeboards") {
		id
		name
		category
		description
		price
		imageUrl
	}
}

Add a new product:

mutation addProduct {
	createProduct(
		name: "Hyperlite Riot Nova"
		category: "Wakeboards"
		description: "This is the Riot Nova, it's sick."
		price: 799
		imageUrl: "https://www.hyperlite.com/images/square.png"
	) {
		id
		name
		category
		description
		price
		imageUrl
	}
}

Update an existing product:

use the actual id string of the product you want to update

mutation updateProduct {
	updateProduct(
		id: "ck8ckndoo0000kb7bi8gdw2li"
		description: "This is teh best wakeboard in existence. Ever. Don't even argue."
	) {
		id
		name
		category
		description
		price
		imageUrl
	}
}

Delete an existing product:

use the actual id string of the product you want to delete

mutation deleteProduct {
	deleteOneProduct(where: { id: "ck8gw1hpu0000lr7biier71xy" }) {
		id
		name
		category
	}
}

⭐ All of your source code will be properly uploaded to GitHub :octocat:
See here: https://github.com/skaduusch/graphql-postgres-docker

⭐ Your ReadMe file will accurately describe your server install and run process and how to use the APIs

  • You're looking at it. 🤘

wakesport-products-graphql-prisma-server's People

Contributors

austinjbennett avatar dependabot[bot] avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.