title: Passing Enum Type as Parameter to GraphQL Query - Quarkus
body: <p>I am having issues passing an enum type as a parameter to a query call. I have the following relevant snippets:</p>
  
  <p><strong>Enum Definition</strong></p>
  
  <pre><code>    @Enum("ConfigurationEnum")
      @Description("The available configuration names")
      public enum ConfigurationEnum{
          allocation_projection("allocation.projection.maxHistoryDays"),
          testing_thingy("testing.graphql.config.service.save");
  
          private final String configurationValue;
          private ConfigurationEnum(String configurationValue){
              this.configurationValue = configurationValue;
          }
  
          @Override
          public String toString() {
              return this.configurationValue;
          }
      }
  </code></pre>
  
  <p><strong>Resource endpoint</strong></p>
  
  <pre><code>    @Query("configurationByName")
      @Description("Get a configuration by name")
      @Transactional
      public Configuration getByName(@Name("name") ConfigurationEnum name){
          return Configuration.getByName(name.toString());
      }
  </code></pre>
  
  <p><strong>Functional Implementation</strong></p>
  
  <pre><code>    @ApplicationScoped
      @Entity
      @Table(name="CONFIGURATION")
      public class Configuration extends PanacheEntityBase {
  
      @Id
      @NotNull
      private String name;
      private String value;
  
      public static Configuration getByName(String name){
          return find("name", name).firstResult();
      }
  </code></pre>
  
  <p><strong>My example query:</strong></p>
  
  <pre><code>query searchByName {
    configurationByName(name: allocation_projection) {
      name
      value
    }
  }
  </code></pre>
  
  <p><strong>The resulting error:</strong></p>
  
  <p><code>"message": "Validation error of type WrongType: argument 'name' with value 'StringValue{value='allocation_projection'}' is not a valid 'Unknown Scalar Type</code></p>
  
  <hr>
  
  <p>The desired behavior is to pass in the argument to <code>configurationByName</code> as an <em>enum</em>, then update the corresponding entry in the database field - the enum value. Using a scalar value - i.e. passing the string directly - everything works as expected. I need to change the type of the argument from a scalar to an enum. Generally, I believe this is done via setting the field type inside of <code>buildQueryType</code> when constructing custom schema. Is there any way to set this option in MicroProfile?</p>
  
  <p>I'm pretty new to GraphQL in general and especially to the MicroProfile paradigm, so please forgive any simple oversights I may have made - I can't find any documentation with a similar case using MicroProfile.</p>
  
  <p>Thanks!</p>