Bonfire.API.GraphQL.RestAdapter (Bonfire v1.0.1-social-alpha.28)

View Source

Summary

Functions

Process a GraphQL response and transform it to JSON.

Helper to require authentication and execute a function with the current user.

Functions

error_fn(response, conn)

json(conn, data)

return(name, ret, conn, transform_fun \\ nil)

Process a GraphQL response and transform it to JSON.

Takes the GraphQL result, extracts data by name, applies optional transformation, and returns JSON response via conn.

success_fn(response, conn)

transform_data(data)

transform_data(data, transform_fun)

with_current_user(conn, fun)

Helper to require authentication and execute a function with the current user.

Returns 401 Unauthorized if no user is logged in.