Sign inSign up

wassonece/m2m-graphql

By wassonece

•Updated over 4 years ago

Image
0

2.1K

wassonece/m2m-graphql repository overview

⁠M2M GraphQL

An unofficial GraphQL API server for interacting with Aptean's Made2Manage⁠ enterprise resource planning (ERP) server.

⁠Quickstart

In order to connect to your M2M instance, create a user in MS SQL that has access to your M2MDataXX database where XX is the desired company number. Remember to limit access to the least amount needed - currently the M2M GraphQL server doesn't implement any mutations so a read-only user is best.

This repository uses Docker⁠ containers to assist in local development. The only local requirements should be docker and docker-compose.

 git clone [email protected]:wasson-ece/m2m-graphql.git
 cd m2m-graphql
 cp .env.example .env
 # Edit your .env file to match your environment settings
 docker-compose run server yarn install
 docker-compose up -d

You can now access the GraphiQL playground at http://localhost:4000/graphiql⁠ to experiment with the API.

The app server will recompile and restart on file changes. You can tail the container for errors using the command docker logs -f m2m-graphql_server_1.

⁠Deployment

  1. Copy .env to production

  2. Run with Docker

    docker run -v ${PWD}/.env:/usr/local/app/.env -p 4000:4000 wassonece/m2m-graphql:latest

⁠Usage

M2M GraphQL currently implements a couple queries that can be viewed in the Schema tab in the GraphiQL playground⁠. For example, the following query will fetch all bins that match the MYBIN% glob within location 01, for each bin fetch its parts, and for each part fetch their on-hand locations.

Properties directly pulled from the M2M database will match their column names in the database, derived or computed properties will be new names. (ex: fcloc, fpartno, and fcstscode vs parts)

{
  getBinsLike(options: { fcbin: "MYBIN%", fcloc: "01" }) {
    fcloc
    fcbindesc
    fcbin
    parts {
      fpartno
      frev
      fdescript
      fcstscode
      fcomment
      fstdmemo
      inonhd {
        fonhand
        flocation
        fbinno
      }
    }
  }
}

Tag summary

Content type

Image

Digest

Size

69.8 MB

Last updated

about 5 years ago

docker pull wassonece/m2m-graphql