github.com/dennys-bd/goals@v0.0.0-20210328114421-251a004d41e3/README.md (about) 1 # Project Archieved 2 # goals 3 4 `goals` is a Golang/GraphQL Framework. `goals` is still in beta release. 5 6 ## installation 7 8 `go get github.com/dennys-bd/goals` 9 10 ## usage 11 12 `goals` has 3 main commands today: 13 14 - init: Used to generate a basic Goals project 15 - scaffold: Used to create GraphQL Models, Schemas and Resolvers 16 - runserver: Used to start the goals application 17 18 ## commands 19 20 ### goals init 21 22 `goals init PROJECTNAME` should start your project under your $GOPATH/src 23 24 ### goals scaffold 25 26 #### scaffold graphql 27 28 ##### Usage 29 30 You can generate a entire model in a syntax rails like, is recommended to use simple quote on the fields of model coz `]!` characters is reserved for bash terminals. 31 ALSO, DONT USE WHITE SPACES, it's used to separate the fields ;) 32 `goals s g <modelname> 'fieldName(param:ParamType,param2:ParamType2):fieldType! relationName:type:[ModelName]!'` 33 34 ##### Verbose 35 36 You can create your model inserting it's fields in line by line using the verbose flag (-v) 37 `goals s g <modelname> -v` 38 39 Console will ask you to insert the first field you can write something like this: (there is no problem using whitespaces where) 40 `fieldName(param: ParamType, param2: ParamType2): FieldType!` 41 42 then console will print informations about the field and you can confirm or erase this field 43 if confirmed it will asks to create another field until you send a blank line. 44 45 should create a suitable model, schema and resolver structures for your new type 46 For now you should use simple quote in your attributes, -Use Spaces to separate the attributes-. 47 48 ##### Flags 49 50 - `--json` 51 It creates a model genarating json value for each attribute of model. 52 - `--no-model` 53 Don't create the model. (Use it if you alread have a model) 54 - `--no-schema` 55 Don't create the schema. (Use it if you alread have a schema) 56 - `--no-resolver` 57 Don't create the resolver. (Use it if you alread have a resolver) 58 - `--resolver` or `-r` 59 Change the resolver name for your model. 60 - `--verbose` or `-v` 61 Is a way of creating your params for the attribute, and create each attribute separately.(You can use spaces now) 62 NO QUITE READY YET. 63 64 #### scaffold auth 65 66 ##### Usage 67 68 `goals s auth` 69 should create a private resolver, with it's auth structures. 70 71 covering commun graphql types: String, Int, Boolean, ID, Float, and Time from `github.com/graph-gophers/graphql-go`. 72 Every other type will be treated as Scalar if you don't specifically declare type before modelName 73 74 ### goals runserver 75 76 ##### Usage 77 78 `goals r` 79 Start your server with some goals pattern configurations. 80 81 ##### Flags 82 - `--port` or `-p` 83 Change the port to serv your goals application 84 - `--env-port` 85 Infer the port from the environment variable `PORT` (The `--port` flag is stronger ifused together, please don't.) 86 - `--env` or `-e` 87 Starts your goals application with the configurations for specified environment - `goalsr -e production` 88 - `--verbose` or `-v` 89 Verbose, right? for now it only prints the schemas 90 91 92 ## todo 93 94 - [x] command init 95 - [x] command scaffold 96 - [x] command scaffold graphql 97 - [x] command scaffold auth 98 - [x] goals core to facilitate serving pages 99 - [x] command runserver 100 - [x] environment separation ready (dotEnv) 101 - [ ] versoning 102 - [ ] scalar file 103 - [ ] database integration 104 - [ ] flag to separate application in database directive ou gateway in init 105 - [ ] flag to separate model in databased ou delivered from external api in scaffold 106 - [ ] write tests for check writing files 107 - [ ] goals core 108 - [ ] goals admin