Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
  dist
  CHANGELOG.md
  README.md
  package.json
Size: Mime:
  README.md

uxui-graphql

    STOREFRONT_APP_SERVICE_HOST=FAKED node dist/index.js
    node dist/index.js
docker kill $(docker ps -q) && docker rm $(docker ps -a -q) && docker rmi $(docker images -q)
m2 kill
killall node
# recursive optional
git clone --recursive -b zzz-combined-docker-image https://jameswiens@bitbucket.org/skava-admin/mono-applications.git
cd mono-applications
# cd docker
# docker-compose -f docker-compose.dev.yml up -d
  1. update code, update package.json version
  2. tag the version
docker build --rm -t skava-graphql:v5.0.8 .
  1. double tag the version
docker tag skava-graphql:v5.0.8 react-dtr.skavaone.com:444/skava/graphql:v5.0.8
docker push react-dtr.skavaone.com:444/skava/graphql:v5.0.8
  1. mono-applications
update the yaml files wiith new versions
  1. go to https://console.cloud.google.com/kubernetes/clusters/details/us-east1-b/your-first-cluster-1?project=skava-react-ecommerce&authuser=1&organizationId=288393691357&tab=details&persistent_volumes_tablesize=50&storage_class_tablesize=50&nodes_tablesize=50
  1. delete old yaml
kubectl delete -f storefront-app-deployment.yaml
  1. create deployment
kubectl create -f storefront-app-deployment.yaml

all in 1

docker build --rm -t skava-graphql:v5.0.8 .
docker tag skava-graphql:v5.0.8 react-dtr.skavaone.com:444/skava/graphql:v5.0.8
docker push react-dtr.skavaone.com:444/skava/graphql:v5.0.8

reference-store

  1. build
make BUILD_LOCAL_DOCKER
  1. tag & push
docker build --rm -t storefront:v7.2.0 dist
docker tag storefront:v7.2.0 react-dtr.skavaone.com:444/skava/storefront:v7.2.0
docker push react-dtr.skavaone.com:444/skava/storefront:v7.2.0

run it

lcally

docker run -p 3000:3000 storefront:v7.2.0

remote to ensure iit deployed

docker run -d -p 3000:3000 storefront:v7.2.0

🚀 GraphQL server

Getting started

(prerequesite - you have node & yarn & xcode/make - mac || make - windows installed)

# 1. Navigate to the folder
# 2. Run yarn install
# 3. Start server using yarn run start  (runs on http://localhost:4000) and open in GraphQL Playground

alt text alt text

Documentation

Commands

  • make dev starts GraphQL server on http://localhost:4000
  • make mock_dev same as make dev, but with mocks
  • make build builds the project (for use in deployment)
  • make build_prod builds the production version of the project (does not include index.js)
  • make tests run the unit tests (runs 1x)
  • make tdd run test-driven-development mode (it will watch the tests for changes and re-run them)
  • make build_schema builds the schema (important to run this, until it's done automatically)
  • make build_fragments generates fragments for all models
  • make build_types generates ts types for all models

Env

  • LOG_LEVEL_STREAM_PROXY=debug for logging proxy requests
  • IS_STANDALONE_GRAPHQL=boolean for running the app on its own
  • LOG_REQUEST_PARAMS=true log all request params
  • LOG_REQUEST_RESPONSE=true log all responses
  • LOG_REQUEST_ERROR=true log all errors in requests
  • API_PORT=4000 port to run the app on, if it's standalone (also compat with skreact)
  • API_URL=http://localhost:4000 the absolute url to run the server requests with
  • CORS=http://1,http://2 cross-origin urls to accept

Project structure

File name                Description         
└── src (directory) Contains the source files for the GraphQL server
  ├── index.js The entry point for the GraphQL server

Features

  • SkavaGraphQL server: The server uses graphql-yoga which is based on Apollo Server & Express

Next


Snippets

proxy

http://localhost:4000/api/productlist/plainteesmen?campaignId=2691&offset=0&limit=100&locale=en_US&storeid=atlanta

mock

  • set your ENV values (cross-env for windows, or just ENV_NAME=value for mac)
  • running this repo standalone requires only a change to start.js

graphiql

  • graphql-playground (available at /playground)
  • graphiql (available at /graphiql)
  • http://localhost:4000/graphiql?query=%7B%0A%20%20productList(categoryId%3A%20%22plainteesmen%22%20limit%3A%2012%20offset%3A%200)%20%7B%0A%20%20%20%09products%20%7B%0A%20%20%20%20%09name%0A%20%20%09%7D%0A%20%20%7D%0A%7D