title: How to Implement Spring Security in Grails Graphql in Grail 4.x
body: <p>How to Implement role in View in Grails Graphql</p>
  <p>class Career {
  String name
  String description
  Integer positions</p>
  <pre><code>static graphql = GraphQLMapping.build {
  
      query('careerByName',Career){
       dataFetcher(new DataFetcher() {
           @Override
           Object get(DataFetchingEnvironment environment) throws Exception {
               return Career.findByName(environment.getArgument('name'))
           }
       })
      }
  }
  
  static constraints = {
  
  
  
  
  }
  static mapping = {
  
  }
  </code></pre>
  <p>}</p>
  <p>class Career {
  String name
  String description
  Integer positions</p>
  <pre><code>static graphql = GraphQLMapping.build {
  
      query('careerByName',Career){
       dataFetcher(new DataFetcher() {
           @Override
           Object get(DataFetchingEnvironment environment) throws Exception {
               return Career.findByName(environment.getArgument('name'))
           }
       })
      }
  }
  
  static constraints = {
  
  
  
  
  }
  static mapping = {
  
  }
  </code></pre>
  <p>}</p>