Where does `yarn run react` fit into the Relay workflow? - react-native

I'm trying to get Relay working with my React Native app and talking to my GraphQL server. I think I'm missing some pieces of understanding.
I'm following the instructions at https://facebook.github.io/relay/docs/relay-modern.html
It details the yarn commands to set up relay and the babel plugin. I added the "relay" script to my package.json like this:
"relay": "relay-compiler --src ./App --schema ./App/Data/schema.graphql"
But, when I run yarn run relay I get
Error: --schema path does not exist: /Users/user/dev/react-native-app/App/Data/schema.graphql.
Yeah. It doesn't exist. Isn't that what this command is supposed to generate? That documentation page doesn't explain what this command outputs, nor what it needs as input. How can I get this command working correctly? Do I really have to hand-write a schema when it already exists on the server?

EDIT, for php
Given that you are generating your schema on a PHP server, you can generate the .graphql file by creating a Node.js script to:
Send an introspection query to your /graphql endpoint
Pass the result to buildClientSchema
Call printSchema with it and write it on the disk
General usage with graphql-js
As far as I know, you effectively need your schema printed in GraphQL language. You can have a look at printSchema for this, to provide it to the relay-compiler.
printSchema will do the JS Object -> Schema Language conversion. If you already have your schema in Schema Language, this is what you need to provide to the relay-compiler.
It may be possible to use directly the JS Object schema, but I don't know how.
For a detailed explanation of the complete setup, you can look at my other answer here.

Related

How to import code from private GitHub repo into snips?

I understand that the normal way to use complex action code in Snips is to place the code in GitHub and pull it from there via Action Type "GitHub".
Is there any way to access a private GitHub repo for this purpose?
If this is not possible, what would be the normal way to use complex action code that cannot be published?
Regarding the "Code Snippets" the documentation says "It is meant for quick testing, or simple interactions." In what respect can Code Snippets support only "simple interactions" ?
You need to make your repo public in order to link it with your console assistant, and code snippets are limited to Python action code. If these are not an option for you you could also make your code run locally by either:
executing it manually (just launch your script, which listens to the MQTT communications via your code or by using Hermes)
placing it in /var/snips/skills and making it executable if you're on Linux. The snips-skill-server will look into this directory at boot and execute any executable file that starts with "action-". See the documentation

CMake Server: Docs mismatch, clarification needed

I was running across this piece of documentation: https://cmake.org/cmake/help/v3.13/manual/cmake-server.7.html
But as it turns out, the description given on how to start the server, is not the same as shown in the documentation. When executing cmake -E server --debug, I am getting the following message:
CMake Error: No protocol versions defined. Maybe you need --experimental?
When adding the suggested flag --experimental, the server will launch, reading from standard input and responding to standard output, as expected. However, all the examples shown on the documentation do not suggest the use of this flag. Plus, I have version 3.13.4 installed as well.
What is the proper way of starting the CMake server, as in how would I specify the protocol version, and why am I asked to use --experimental?
My main goal is to find out if I can extract values like targets and their associated information (like CFLAGS) off CMake. Using this server command would certainly let me do this by just writing a small piece of NodeJS code to interact with it.

PhantomJS -headless browseer

I have to automate a test case in which a list in a particular dashboard is created. We decided to use PhantomJS headless browser. Since I am new to it, I tried creating test myself. Following are the steps I followed just to open the target website.
Created directory phantoms
cd phantoms and installed phantom module using command npm install phantom --save
Created file createlist.js:
createlist.js contents:
var phantom = require('phantom');
var page = require('webpage');
page.open('http://facebook.com', function(status) {
console.log("Status: " + status);
if(status === "success") {
page.render('example.png');
}
phantom.exit();
});
When i execute command node create_list.js, I am getting the following error:
page.open('interact2.responsys.net/interact/jsp/jindex.jsp&#‌​39;, function(st atus) { ^ TypeError: page.open is not a function at Object.<anonymous> (C:\Users\shilshet\New folder\phantom\create_list.js:3 :6) at Module._compile (module.js:413:34)
If I try to execute command like
phantomjs C:/Users/shilshet/New folder/phantom/create_list.js
I am getting this error
bash: phantomjs: command not found
Note: I am using cygwin to execute commands
What I am going wrong? I installed phantomjs module also in the same folder as my node.js.
Could anyone let me know apart from using headless browser, how does one create a profile list in Oracle responsys via REST API call?
While the first answer here should work, it's not the best way to accomplish what you need. The cleaner way to solve your issue is to add the location of your phantomjs executable to your PATH variable defined in a file such as ~/.bash_history.
The file may not be defined, so you may need to create the file, and then add PATH="/path/to/phantomjs/executable"
If you prefer to edit your PATH var via a GUI: Edit PATH variable via Windows GUI
The reason you need to do this, is that your system natively iterates over paths defined in the 'PATH' variable in order to determine where executable files are. Since phantomjs is not included in the PATH variable (nonexistent in the environment), and you try to run 'phantomjs', your system simply does not know which executable to call (or rather it doesn't know it exists)
The reason this is the better approach is:
You don't need to explicitly write out the path of where phantomjs is located every time you want to run it (it's just cleaner looking too)
What happens if you you call phantomjs from multiple files, and the location of where phantomjs is stored changes? If you explicitly typed phantomjs' absolute path everywhere, then you need to change EVERY place you typed it! Nightmare! With this approach, you simply change it in one place; the file that defines your PATH variable
It's pretty conventional to add new file paths to your PATH env variable. You shouldn't clutter it, but it makes sense in this case to add it
For this: "Could anyone let me know apart from using headless browser, how does one create a profile list in Oracle responsys via REST API call?"... I would recommend asking a separate question. I personally don't know, but if you raise the new question, you may get support from someone who does.
Hope this helps! If you need any help whatsoever, let me know.
You mixed up two ways of running PhantomJS.
The more straightforward, more simple way is just launching PhantomJS from command line and giving it the path of a script as an argument. On Windows you would do it like this:
"C:/Users/shilshet/New folder/phantom/phantomjs.exe" "C:/Users/shilshet/New folder/phantom/create_list.js"
Note the quotes here, they're needed because there are spaces in filenames.

Running a JSON graph locally

I've been using Flowhub.io to do my development on the nodejs device. Now that the GUI-based design is done, I'm ready to take it offline and run the code via the command line. How would do I do this? I have the JSON file corresponding to the graph I created online, but not sure how to use the noflo nodejs module.
Could someone help me by showing me an example of how to load a graph using the noflo module, please? Thanks!
f you want to run an existing graph, you can use the --graph option.
noflo-nodejs --graph graphs/MyMainGraph.json
If you also want the process to exit when the network stops, you can pass --batch.
PS: I added this to the noflo-nodejs README.

BigQuery error in query operation : Project id not found

I am getting a project not found error when trying to run queries with the bq command line tool or the BigQuery browser window.
I've registered the BigQuery API with the project. I've also setup billing.
For bq, I've setup the .bigqueryrc with the numeric project id.
When I try to query the system response is using the friendly project id so it seems that BigQuery is aware enough to do this mapping of numeric to friendly ids.
I've used the bq shell to verify that prompt reflects the right project id.
I can run 'bq ls publicdata:samples' just fine so I'm assuming the authorization really kicks in to query the data.
What's missing or wrong here?
It looks like there is an issue recognizing projects created through AppEngine. This is a bug and we're actively working on a fix.
As a workaround, you can use a project created through https://code.google.com/apis/console instead.
In my project I didn't have App Engine enabled. For me it was solved by authenticating again though gcloud:
$ gcloud auth login