Macro for defining view structs that project a subset of fields from a schema module.
Views provide IDE autocomplete, automatic $select injection, and compile-time
field validation against the parent schema.
Usage
defmodule MyApp.UserSummary do
use GraphApi.View,
schema: GraphApi.Schema.User,
fields: [:id, :display_name, :mail, :job_title]
endThis generates:
defstructwith only the listed fieldsfrom_map/1— casts via parent schema'sfrom_map/1, then takes only view fieldsto_map/1— converts back to camelCase via parent schema__select__/0— returns camelCase field names for auto$selectinjection__schema__/0— returns the parent schema module