All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.sentry.spring.jakarta.graphql.SentryGraphqlBeanPostProcessor Maven / Gradle / Ivy

There is a newer version: 8.0.0-rc.3
Show newest version
package io.sentry.spring.jakarta.graphql;

import org.jetbrains.annotations.ApiStatus;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.core.Ordered;
import org.springframework.core.PriorityOrdered;
import org.springframework.graphql.execution.BatchLoaderRegistry;

@ApiStatus.Internal
public final class SentryGraphqlBeanPostProcessor implements BeanPostProcessor, PriorityOrdered {

  @Override
  public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
    if (bean instanceof BatchLoaderRegistry) {
      return new SentryBatchLoaderRegistry((BatchLoaderRegistry) bean);
    }
    return bean;
  }

  @Override
  public int getOrder() {
    return Ordered.LOWEST_PRECEDENCE;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy