Write and Commit Custom Queries
Last updated
Last updated
The Custom Queries section in Neurelo is a dynamic workspace where you can manage and create custom queries in native query code. Here’s a step-by-step guide to writing your custom queries:
Creating custom queries in Neurelo is a straightforward process, facilitated by a user-friendly query editor and built-in AI Assist capabilities. Here’s a step-by-step guide to writing your custom queries:
Locating the Query Editor:
Inside your Project, go to the Definition page from the left navigation panel.
Click on the Custom Query tab, this will open the custom query editor. This is where you can review and write your queries.
Starting a New Custom Query:
When accessing the Custom Query section for the first time, you have two options to start creating custom queries:
Look for a section labeled "Custom Queries" with a "Plus" sign next to it.
Alternatively, you can click on the "New" button located centrally on the page.
Clicking either option will open a pop-up prompt for creating a new endpoint
API Mode and Naming the Endpoint:
In the pop-up, you will be asked to select a mode (REST/GraphQL) for your endpoint and provide an "Endpoint Name."
Remember, endpoint names can only contain alphanumeric characters, underscores, and dashes (no spaces). Examples: cityQuery
, city_query
, QUERY500
, 200query
.
After entering a valid name, you can either finalize the creation by clicking "Submit", or cancel by clicking "Cancel"
Writing the Query:
Once you submit the endpoint name, the query editor opens for you to type your query.
For instance, you can write a query like such as:
Prettifying Your Query:
To enhance readability, you can prettify your query format.
Locate and click the "Prettify" button at the top of the Query editor. This will instantly format your query into a more readable and user-friendly layout.
Testing your Custom Query
After writing a query, you can test the query right on the editing page.
Look for "▶️ Test Query" button. Clicking this will open a test playground
Enter the "API Key" for the running environment that you wish test this custom query against
Note - this query will actually run against the data source in use in the environment. You will need to acknowledge this by selecting the checkbox to be able to try this query
You will see the data-set result or any error (in case query was not formed correctly) in the playground window
Saving Custom Queries (Commit)
After writing a query, you will need to save it for future use.
Look for a "Commit" on the page. Clicking this will store your query within Neurelo and instantly create an API endpoint for this query which can be used in an environment.
Searching for Saved Queries:
To find a previously saved query, use the search feature on the Custom Query page.
Enter keywords or the exact name of the query in the search bar.
The search functionality helps you quickly locate the desired query among all the queries you've saved.
Don’t forget to Commit your Custom Query before leaving the page. Committing will also automatically version your custom query.
These features on the Custom Query page allow for efficient management of your custom queries. Whether you're building complex queries for advanced data retrieval or simply experimenting with different data manipulations, Neurelo's environment supports and streamlines your workflow.