graphql-ruby: How to get the name of query or mutation in controller Note

As the title says.

You can get it using GraphQL.parse.

GraphQL.parase(params[:query]).definitions[0].selections[0].name

If you know a better way, please let me know.

Recommended Posts

graphql-ruby: How to get the name of query or mutation in controller Note
How to get the class name / method name running in Java
How to get the class name of the argument of LoggerFactory.getLogger when using SLF4J in Java
How to get the id of PRIMAY KEY auto_incremented in MyBatis
How to get the date in java
How to get the length of an audio file in java
How to get the absolute path of a directory running in Java
How to get today's day of the week
[Java] How to get the authority of the folder
How to get the ID of a user authenticated with Firebase in Swift
[Swift] How to change the order of Bar Items in Tab Bar Controller [Beginner]
[Java] How to get the URL of the transition source
Get the name of the test case in the JUnit test class
[Java] How to get the maximum value of HashMap
[Rails] How to change the column name of the table
[Android] How to get the setting language of the terminal
[Rails] How to get the contents of strong parameters
[Swift] How to get the document ID of Firebase
[IOS] How to get the table name from AWS DynamoDB
How to get the longest information from Twitter as of 12/12/2016
How to derive the last day of the month in Java
[jsoup] How to get the full amount of a document
How to get parameters in Spark
How to name variables in Java
[Rails / Routing] How to refer to the controller in the directory you created
[Rails] How to get the URL of the transition source and redirect
[Swift5] How to get an array and the complement of arrays
How to set the IP address and host name of CentOS8
Fix the file name of war to the one set in Maven
[Swift UI] How to get the startup status of the application [iOS]
How to get the contents of Map using for statement Memorandum
[jOOQ] How to CASE WHEN in the WHERE / AND / OR clause
[chown] How to change the owner of a file or directory
[For beginners] How to get the Ruby delayed railway line name
How to increment the value of Map in one line in Java
Get the result of POST in Java
How to set the indent to 2 single-byte spaces in the JAXB implementation of the JDK
How to change app name in rails
How to get date data in Ruby
How to name variables 7 selections of discomfort
[Note] How to get started with Rspec
Confirmation and refactoring of the flow from request to controller in [httpclient]
How to determine the number of parallels
[Java] How to get the current directory
How to get the current date as a string in yyyyMMdd format
How to change the maximum and maximum number of POST data in Spark
[Rails] How to get the user information currently logged in with devise
[Java] How to get to the front of a specific string using the String class
How to find the total number of pages when paging in Java
How to sort the List of SelectItem
How to get the value after "_" in Windows batch like Java -version
How to constrain the action of the transition destination when not logged in
How to get the setting value (property value) from the database in Spring Framework
How to change the value of a variable at a breakpoint in intelliJ
I want to get the field name of the [Java] field. (Old tale tone)
Android development, how to check null in the value of JSON object
[swift5] How to change the color of TabBar or the color of item of TabBar with code
How to reference a column when overriding the column name method in ActiveRecord
How to create your own annotation in Java and get the value
How to get Excel sheet name list in Java (POI vs SAX)
In Apache POI 3.15, when I get the result of the formula, FormulaParseException occurs (the formula refers to "cell of sheet name including" ・ ")