biocontext_kb.utils
===================

.. py:module:: biocontext_kb.utils


Functions
---------

.. autoapisummary::

   biocontext_kb.utils.execute_graphql_query
   biocontext_kb.utils.fetch_graphql_schema
   biocontext_kb.utils.slugify


Package Contents
----------------

.. py:function:: execute_graphql_query(endpoint_url, query_string, variables=None, headers=None)

   Make a generic GraphQL API call.

   :param endpoint_url: The GraphQL endpoint URL
   :type endpoint_url: str
   :param query_string: The GraphQL query or mutation as a string
   :type query_string: str
   :param variables: Variables for the GraphQL query
   :type variables: dict, optional
   :param headers: HTTP headers to include
   :type headers: dict, optional

   :returns: The response data from the GraphQL API
   :rtype: dict


.. py:function:: fetch_graphql_schema(endpoint_url)

   Fetch the GraphQL schema from the given endpoint URL.

   :param endpoint_url: The GraphQL endpoint URL.
   :type endpoint_url: str

   :returns: The fetched GraphQL schema.
   :rtype: GraphQLSchema


.. py:function:: slugify(name)

   Slugify a name by replacing spaces with underscores and converting to lowercase.

   Allow only alphanumeric characters and underscores.


