Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Commit

Permalink
Address ra0x3 feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
deekerno committed Oct 17, 2023
1 parent a8b33c7 commit bacecbc
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions packages/fuel-indexer-lib/src/graphql/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ fn inject_native_entities_into_schema(schema: &str) -> String {
}
}

/// Inject internal types into the schema. In order to support popular
/// functionality (e.g. cursor-based pagination) and minimize the amount
/// of types that a user needs to create, internal types are injected into
/// the `ServiceDocument`. These types are not used to create database tables/columns
/// or entity structs in handler functions.
pub(crate) fn inject_internal_types_into_document(
mut ast: ServiceDocument,
base_type_names: &HashSet<String>,
Expand Down Expand Up @@ -186,10 +191,11 @@ fn create_edge_type_for_list_field(
))
}

/// Generate connection type defintion for a list field on an entity.
fn create_connection_type_def_for_list_entity(name: &Name) -> TypeSystemDefinition {
let dummy_position = Pos {
line: 999,
column: 99,
line: usize::MAX,
column: usize::MAX,
};

let obj_type = ObjectType {
Expand Down Expand Up @@ -276,10 +282,11 @@ fn create_connection_type_def_for_list_entity(name: &Name) -> TypeSystemDefiniti
))
}

/// Generate `PageInfo` type defintion for use in connection type defintions.
fn create_page_info_type_def() -> TypeSystemDefinition {
let dummy_position = Pos {
line: 999,
column: 99,
line: usize::MAX,
column: usize::MAX,
};

let obj_type = ObjectType {
Expand Down

0 comments on commit bacecbc

Please sign in to comment.