GqlCase.GqlLoader (GqlCase v0.2.0)

View Source

Defines the functions used to load GQL documents based on the document path.

Summary

Functions

When provided a path to a GQL document, expands all import statements and attempts to parses it with Absinthe.

When provided the source code of a GQL document, expands all import statements and attempts to parses it with Absinthe.

Functions

load_file!(document_absolute_path)

@spec load_file!(binary()) :: binary()

When provided a path to a GQL document, expands all import statements and attempts to parses it with Absinthe.

Returns the query string source with imports appended.

For example:

load_file!("assets/js/MyQuery.gql")

load_string!(query_string)

@spec load_string!(binary()) :: binary()

When provided the source code of a GQL document, expands all import statements and attempts to parses it with Absinthe.

Returns the query string source with imports appended.

For example:

load_string!(@my_query_source)