Skip to main content

No project description provided

Project description

Ariadne Codegen Field Fix Plugin

This plugin aims to fix a really annoying issue with ariadne-codegen, where the original fieldname (from the provided graphql schema) isn't used when creating custom field calls. This disparity causes queries to break if the graphql API cannot handle snake-case, but you want generated field names to use snake-case.

Installation

All you have to do to install the plugin is run

pip install ariadne-codegen-field-fix

Then just add the plugin to your ariadne config.

Usage

To use this plugin simply add "ariadne_codegen_field_fix" to your plugins list.

Example

[tool.ariadne-codegen]
schema_path = "schema.graphql"
enable_custom_operations = true
convert_to_snake_case = true
plugins = ["ariadne_codegen_field_fix"]

Under the hood

Under the hood the actual ariadne-codegen plugin class does nothing (due to poor hook support), the real magic happens when the plugin module gets loaded and the client_generators.custom_fields.CustomFieldsGenerator class gets monkey patched (via client_generators.package.CustomFieldsGenerator).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ariadne_codegen_field_fix-0.1.0.tar.gz (2.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ariadne_codegen_field_fix-0.1.0-py3-none-any.whl (2.5 kB view details)

Uploaded Python 3

File details

Details for the file ariadne_codegen_field_fix-0.1.0.tar.gz.

File metadata

File hashes

Hashes for ariadne_codegen_field_fix-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a51b34f4b54f245e43a16d3f85195ae21a947eaf66e0ebb75270e02c824990bd
MD5 a453e342ae8b87020bae71bacc813c9c
BLAKE2b-256 f352ffe5fd28e846ddaed6e0790f6846d00a5383f5599e9d19a1555bfface730

See more details on using hashes here.

Provenance

The following attestation bundles were made for ariadne_codegen_field_fix-0.1.0.tar.gz:

Publisher: build-and-publish.yaml on ewen-lorimer/ariadne-codegen-field-fix

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ariadne_codegen_field_fix-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ariadne_codegen_field_fix-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b9304213d105519d572760844643948cf5193c14f842d7f8464901a3ba2b0e7f
MD5 35c20b10ccc7e74c28eae140ec7f37a2
BLAKE2b-256 523f53525f72deae07539b8c14a3b30d7130d33b0e5ffdc2661e903ba1f83523

See more details on using hashes here.

Provenance

The following attestation bundles were made for ariadne_codegen_field_fix-0.1.0-py3-none-any.whl:

Publisher: build-and-publish.yaml on ewen-lorimer/ariadne-codegen-field-fix

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page