Skip to content

Support for Hasura-styled query? #147

Open
@stevefan1999-personal

Description

@stevefan1999-personal

Hasura has their own style of writing queries:
https://hasura.io/docs/1.0/graphql/manual/queries/query-filters.html

Here's an example adapter to adapt some compatibility with Hasura:

export class CustomAdapter extends DefaultAdapter {
  public getRootMutationName: () => string = () => 'mutation_root'
  
  public getRootQueryName: () => string = () => 'query_root'
  
  public getConnectionMode (): ConnectionMode {
    return ConnectionMode.PLAIN
  }
  
  public getArgumentMode (): ArgumentMode {
    return ArgumentMode.TYPE
  }
  
  public getNameForFetch (model: Model, plural: boolean): string {
    return model.singularName
  }
  
  public prepareSchemaTypeName (name: string): string {
    return name
  }
}

However, since the filter name cannot be changed (fixed to be "where"), I wonder if we can change it from the plugin -- Let's add more adapter transforms for that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions