title: Inject bean into DataFetcher of GraphQL
body: <p>I'm using <strong>Spring</strong> &amp; graphql-java (<strong>graphql-java-annotation</strong>) in my project.
  For retrieving data part, i'm using a DataFetcher to get data from a service (from database).</p>
  
  <p>The weird thing is that: <code>myService</code> is always <em>null</em>. Anyone know the reason?</p>
  
  <p><em>DataFetcher</em></p>
  
  <pre><code>@Component
  public class MyDataFetcher implements DataFetcher {
  
      // get data from database
      @Autowired
      private MyService myService;
  
      @Override
      public Object get(DataFetchingEnvironment environment) {
          return myService.getData();
      }
  }
  </code></pre>
  
  <p><em>Schema</em></p>
  
  <pre><code>@Component
  @GraphQLName("Query")
  public class MyGraphSchema {
  
      @GraphQLField
      @GraphQLDataFetcher(MyDataFetcher.class)
      public Data getData() {
          return null;
      }
  }
  </code></pre>
  
  <p><em>MyService</em></p>
  
  <pre><code>@Service
  public class MyService {
  
      @Autowired
      private MyRepository myRepo;
  
      @Transactional(readOnly = true)
      public Data getData() {
          return myRepo.getData();
      }
  }
  </code></pre>
  
  <p><em>Main test</em></p>
  
  <pre><code>@Bean
  public String testGraphql(){
      GraphQLObjectType object = GraphQLAnnotations.object(MyGraphSchema.class);
      GraphQLSchema schema = newSchema().query(object).build();
      GraphQL graphql = new GraphQL(schema);
  
      ExecutionResult result = graphql.execute("{getData {id name desc}}");;
      Map&lt;String, Object&gt; v = (Map&lt;String, Object&gt;) result.getData();
      System.out.println(v);
      return v.toString();
  }
  </code></pre>