This repository was archived by the owner on Sep 12, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +8
-21
lines changed
functions-templates/js/fauna-graphql Expand file tree Collapse file tree 2 files changed +8
-21
lines changed Original file line number Diff line number Diff line change @@ -117,19 +117,11 @@ module.exports.serverSettings = async devConfig => {
117117 ) ; // if settings.command is empty, its bc no settings matched
118118 }
119119 if ( devConfig . port ) {
120- settings . proxyPort = assignLoudly (
121- devConfig . port ,
122- settings . proxyPort || null ,
123- tellUser ( "proxyPort" )
124- ) ; // if settings.proxyPort is empty, its bc no settings matched
120+ settings . proxyPort = devConfig . port || settings . proxyPort ;
125121 const regexp =
126122 devConfig . urlRegexp ||
127123 new RegExp ( `(http://)([^:]+:)${ devConfig . port } (/)?` , "g" ) ;
128- settings . urlRegexp = assignLoudly (
129- settings . urlRegexp ,
130- regexp ,
131- tellUser ( "urlRegexp" )
132- ) ;
124+ settings . urlRegexp = settings . urlRegexp || regexp ;
133125 }
134126 settings . dist = devConfig . publish || settings . dist ; // dont loudassign if they dont need it
135127 }
Original file line number Diff line number Diff line change @@ -7,15 +7,14 @@ function createFaunaGraphQL() {
77 }
88 console . log ( "Upload GraphQL Schema!" ) ;
99
10- var request = require ( "request " ) ;
10+ const fetch = require ( "node-fetch " ) ;
1111 const fs = require ( "fs" ) ;
1212 const path = require ( "path" ) ;
1313 var dataString = fs
1414 . readFileSync ( path . join ( __dirname , "schema.graphql" ) )
1515 . toString ( ) ; // name of your schema file
1616
1717 var options = {
18- url : "https://graphql.fauna.com/import" ,
1918 method : "POST" ,
2019 body : dataString ,
2120 auth : {
@@ -24,16 +23,12 @@ function createFaunaGraphQL() {
2423 }
2524 } ;
2625
27- request ( options , callback ) ;
28-
29- function callback ( error , response , body ) {
30- if ( ! error && response . statusCode == 200 ) {
31- // // for debugging
26+ fetch ( "https://graphql.fauna.com/import" , options )
27+ . then ( body => {
28+ // // uncomment for debugging
3229 // console.log("body", body);
33- } else {
34- console . error ( "something wrong happened: " , { error, body } ) ;
35- }
36- }
30+ } )
31+ . catch ( err => console . error ( "something wrong happened: " , { err } ) ) ;
3732}
3833
3934createFaunaGraphQL ( ) ;
You can’t perform that action at this time.
0 commit comments