Skip to content

Add graphql support for taxonomy - #42

Open
adithyasamavedhi-ttd wants to merge 2 commits into
mainfrom
add-graphql-support-for-taxonomy
Open

Add graphql support for taxonomy#42
adithyasamavedhi-ttd wants to merge 2 commits into
mainfrom
add-graphql-support-for-taxonomy

Conversation

@adithyasamavedhi-ttd

@adithyasamavedhi-ttd adithyasamavedhi-ttd commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

What does this MR do:

  • Adds graphQL support for the taxonomy GraphQL operations

REST → GraphQL → SDK mapping

REST endpoint What it does GraphQL operation ttd-data SDK function
POST /v3/thirdpartydata Create third-party taxonomy segments mutation thirdPartyDataUpsert(input: [ThirdPartyDataUpsertInput!]!)ThirdPartyDataUpsertResults client.third_party_taxonomy.upsert_segments(...) — 1–1000 SegmentInput per call
PUT /v3/thirdpartydata Update existing segments Same mutation — the server returns mode: CREATE | UPDATE per segment client.third_party_taxonomy.upsert_segments(...) — omit a key to leave that field unchanged
POST /v3/thirdpartydata/query Look up segments for a provider, optionally filtered by element ID thirdPartyDataProvider(id).thirdPartyTargetingDataSegments(where: {providerElementId: {in: [...]}}, first, after) client.third_party_taxonomy.query_segments(...)
GET /v3/thirdpartydata/status/{providerId}/{providerElementId} Read a single segment's taxonomy approval status Same connection, where: {providerElementId: {eq: ...}}, selecting taxonomyApprovalStatus client.third_party_taxonomy.query_segment_taxonomy_status(...)
  • Add support to execute custom graphql queries if the user comes up with the query
  • Adds a scirpt to validate the graphql documents against the schema using instrospction ( currently runs on-demand)
  • Adds a example script to run graphql operations for testing

Tests:

  1. Query Segments:
Screenshot 2026-08-25 at 3 12 07 PM Screenshot 2026-08-25 at 3 00 58 PM 1
  1. Query Segments next page:
Screenshot 2026-08-25 at 3 11 42 PM Screenshot 2026-08-25 at 3 09 15 PM
  1. Create Segments:
Screenshot 2026-08-25 at 3 10 40 PM Screenshot 2026-08-25 at 2 56 59 PM
  1. Get Taxonomy Approval Status:
Screenshot 2026-08-25 at 3 12 36 PM Screenshot 2026-08-25 at 2 59 06 PM 1

@adithyasamavedhi-ttd
adithyasamavedhi-ttd requested a review from a team August 21, 2026 17:25
@adithyasamavedhi-ttd
adithyasamavedhi-ttd force-pushed the add-graphql-support-for-taxonomy branch 9 times, most recently from 0ba6244 to 5f9f0b3 Compare August 25, 2026 23:45
Comment thread examples/graphql_example.py Outdated
ELEMENT_ID = os.getenv("GRAPHQL_EXAMPLE_ELEMENT_ID", "").strip()

# The token is passed per call, not baked into the client.
client = DataClient()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not? Wouldn't it be the same token for most calls?

We might also want to use this same pattern to internalize oAuth2 token refresh automagically inside the client

GraphQL taxonomy operations (upsert_segments, upsert_segment,
query_segments, query_segment_taxonomy_status) via a typed GraphQL client
on DataClient, validated offline against the Impala subgraph SDL.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@adithyasamavedhi-ttd
adithyasamavedhi-ttd force-pushed the add-graphql-support-for-taxonomy branch from 5f9f0b3 to b4046d7 Compare September 3, 2026 22:07
@adithyasamavedhi-ttd
adithyasamavedhi-ttd force-pushed the add-graphql-support-for-taxonomy branch from b4046d7 to 7500d44 Compare September 3, 2026 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants