Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds location field to Group and SchoolActionStat types #263

Merged
merged 5 commits into from Aug 3, 2020

Conversation

@aaronschachter
Copy link
Member

aaronschachter commented Jul 31, 2020

What's this PR do?

This pull request adds support for the location fields and filters added to the Group and ActionStat resources in DoSomething/rogue#1082.

Example request:

{
  schoolActionStats(location: "US-TX") {
    actionId
    location
    schoolId
    impact
  }
}

Example response:

{
  "data": {
    "schoolActionStats": [
      {
        "actionId": 11,
        "location": "US-TX",
        "schoolId": "4809500",
        "impact": 8
      }
    ]
  },
  ...

How should this be reviewed?

👀

Any background context you want to provide?

We'll eventually drop the state column from the groups table once Rogue and Phoenix are updated to query location per the discussions in DoSomething/rogue#1079 (comment)

Relevant tickets

References Pivotal #174021616.

Checklist

  • This PR has been added to the relevant Pivotal card.
  • Added appropriate feature/unit tests.
@aaronschachter aaronschachter requested a review from DoSomething/applications as a code owner Jul 31, 2020
@aaronschachter aaronschachter requested a review from Vmack Jul 31, 2020
@DFurnes
DFurnes approved these changes Aug 3, 2020
Copy link
Member

DFurnes left a comment

Looks good! 🌐

@@ -214,8 +214,10 @@ const typeDefs = gql`
goal: Int
"The group city."
city: String
"The group location."
location(format: LocationFormat = ISO_FORMAT): String

This comment has been minimized.

@DFurnes

DFurnes Aug 3, 2020

Member

Right now, we handle this format argument on posts by deciding which Rogue property to return for this field. Since we don't have a locationName on stats (computed here for posts), we should probably omit this format argument.

This comment has been minimized.

@DFurnes

DFurnes Aug 3, 2020

Member

If we are planning to add that on the ActionStat resource in Rogue though, I'm fine to keep! (And, longer term, I wonder if this ISO-to-human conversion is something we can just handle in GraphQL for simplicity...)

This comment has been minimized.

@aaronschachter

aaronschachter Aug 3, 2020

Author Member

Thanks for catching this -- I'll remove. Didn't realize there was a location_name property at all, and then 👀 DoSomething/rogue#842 when digging around..

ISO to human in GraphQL sounds like the way to go -- I figured that adding ISO support to schools would just be done within GraphQL so we don't have to alter our Great Schools import (which is simply just importing their raw data)

src/schema/rogue.js Outdated Show resolved Hide resolved
aaronschachter and others added 2 commits Aug 3, 2020
Co-authored-by: David Furnes <[email protected]>
@aaronschachter aaronschachter merged commit 54a41e3 into master Aug 3, 2020
1 check passed
1 check passed
ci/circleci: build Your tests passed on CircleCI!
Details
@aaronschachter aaronschachter deleted the groups-location branch Aug 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.