openapi-generator/bin/graphql-schema-petstore.sh
William Cheng 4be605bcb7
GraphQL Server (#1603)
* Add GraphQL express/apollo server generator

* add basic resolvers; adjust parameters/input types

* small adjustments and improvements

* adjust logger config for GraphQL generators

* remove MaxPermSize form bash script as it will be removed from later Java versions; add isNullable utility helper method; Adjust TODOs for graphql implementation

* re-created samples for graphql config and server generators

* re-added templates for graphql config generator

* add graphql-config-petstore bash script

* add isNullable utility method

* fix javadoc issues

* adjust licence headers

* rename Generator to Codegen for GraphQL classes

* renaming, minor enhancement to graphql generator

* add graphql server samples

* add windows batch files, rename directory
2018-12-05 18:20:53 +08:00

33 lines
922 B
Bash
Executable File

#!/bin/sh
SCRIPT="$0"
echo "# START SCRIPT: $SCRIPT"
while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
SCRIPT="$link"
else
SCRIPT=`dirname "$SCRIPT"`/"$link"
fi
done
if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`dirname "$SCRIPT"`/..
APP_DIR=`cd "${APP_DIR}"; pwd`
fi
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
if [ ! -f "$executable" ]
then
mvn -B clean package
fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties $@"
ags="generate -t modules/openapi-generator/src/main/resources/graphql-schema -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g graphql-schema -o samples/config/petstore/graphql-schema -DpackageName=petstore $@"
java $JAVA_OPTS -jar $executable $ags